File upload 使用Ruby/Capybara/autoIT上传文件的脚本

File upload 使用Ruby/Capybara/autoIT上传文件的脚本,file-upload,capybara,autoit,File Upload,Capybara,Autoit,我正试图用水豚脚本上传一个文件。我从下面的链接获得了一些帮助,我正在尝试使用下面链接中指定的autoIT选项: 从上一页,我有一个关于以下两行的问题: find_field(<<upload_file_id>>).click system("<<full_path>>\\file_upload.exe \"#{<<file_path>>}\" \"File Upload\"") 另外,系统命令是否也会单击对话框中的“打

我正试图用水豚脚本上传一个文件。我从下面的链接获得了一些帮助,我正在尝试使用下面链接中指定的
autoIT
选项:

从上一页,我有一个关于以下两行的问题:

find_field(<<upload_file_id>>).click

system("<<full_path>>\\file_upload.exe \"#{<<file_path>>}\" \"File Upload\"")

另外,
系统
命令是否也会单击对话框中的“打开”按钮,或者我是否需要为此编写单独的脚本?

为什么不使用来自Capybara的附加文件方法

试试这个 系统(“C:/cumber/cumberdemo/features/file_upload.exe/”#
{“C:/Cucumber/cucumberdemo/Capybara.png”}\\文件上传\\“”) 文件路径也应该放在你喜欢的双引号中

{“文件路径”}
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}/"")