I'm trying to upload a file using Capybara script. I got some help from the below link and I'm trying to use the autoIT option that specified in the below link:
Testing HTML5 File Upload with Capybara/Selenium Webdriver - Ruby
From the above page, I have a question on the below two lines:
find_field(<<upload_file_id>>).click
system("<<full_path>>\\file_upload.exe \"#{<<file_path>>}\" \"File Upload\"")
Thanks to the script, I have created an .exe with the given code and gave the above two lines in order to upload the file, but it is giving a syntax error.
What is "File Upload" in the above syntax? Is this the name of the file that I would like to upload? I tried so many ways (forward/backward slashes), but it is returning Syntax error (syntax error, unexpected keyword_end, expecting ')' (SyntaxError)). Here is what my syntax is. Please suggest and let me know what I'm missing. Appreciate suggestions in this regard. Any example with a specific file name in the syntax will really helps.
system("C:/Cucumber/cucumberdemo/features/file_upload.exe/"#
{C:/Cucumber/cucumberdemo/Capybara.PNG}\"\File Upload\"")
system("C:\Cucumber\cucumberdemo\features\file_upload.exe\"#
{C:\Cucumber\cucumberdemo}\"\"Capybara.PNG\"")
system("C:/Cucumber/cucumberdemo/features//file_upload.exe/"#
{C:/Cucumber/cucumberdemo}/"/"Capybara.PNG/"")
system("C:/Cucumber/cucumberdemo/features/file_upload.exe/"#
{C:/Cucumber/cucumberdemo/Capybara.PNG}/"")
Also, will the System command also click the "Open" button from the dialog box or do I need to write a separate script for that?