Selenium webdriver 无法在Ruby Selenium中单击浏览按钮

Selenium webdriver 无法在Ruby Selenium中单击浏览按钮,selenium-webdriver,Selenium Webdriver,HTML: <div id="file_input_overlapped" style="position: absolute; right:0px; width: 115px; height: 100%; overflow: hidden; "> <button id="file_input_button_overlapped" style="position: absolute; width: 100%; height: 100%;"> Browse... </

HTML:

<div id="file_input_overlapped" style="position: absolute; right:0px; width: 115px; height: 100%; overflow: hidden; ">
<button id="file_input_button_overlapped" style="position: absolute; width: 100%; height: 100%;"> Browse... </button>
<input id="fileToUpload" name="fileToUpload" onchange="changeFileName(this);" style="position: absolute; width: 100%; height: 100%; opacity: 0; filter: alpha(opacity=0); -ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';" type="file">
</div>
这句话错了

"Selenium::WebDriver::Error::TimeOutError: Element not visible in 60 seconds".
我尝试的-我尝试将(
C:\\..
)字符串发送到文本框,这样我们就不必点击浏览按钮。但是文本框是不可选择的


谁能告诉我怎么点击浏览按钮吗?Selenium找不到它,因为它是隐藏的?

显示如何将文件路径发送到
输入
字段。另外,请尝试
按钮(:browse_按钮,:xpath=>“(//input[@id='fileToUpload'])[2]”
按钮(:browse_按钮,:xpath=>“(//input[@id='fileToUpload'])不起作用。请选择_文件元素。发送_键(“C:\\Users\\me\\Desktop\\my_file.txt”)和文本_字段(:choose_文件,:xpath=>”/*[@id='file\u name\u重叠])。是否尝试过:
按钮(:浏览按钮,:id=>“文件输入按钮重叠”)
"Selenium::WebDriver::Error::TimeOutError: Element not visible in 60 seconds".