C# 使用selenium时,发送密钥在上载文件元素上不起作用
我有一个需要自动化的网页,其中包含一个文件上传元素(C# 使用selenium时,发送密钥在上载文件元素上不起作用,c#,selenium,selenium-webdriver,C#,Selenium,Selenium Webdriver,我有一个需要自动化的网页,其中包含一个文件上传元素() 对于上载文档,我使用的是发送键(docUrl) this.WaitForElement("XPATH", xpathAppFileUploaderButton); fileUploader = this.FindControlByXPath(xpathAppFileUploaderButton); fileUploader.SendKeys(filePath); 问题是,这段代码在IE8中运行良好,但当我移动到IE9(window7
)
对于上载文档,我使用的是发送键(docUrl)
this.WaitForElement("XPATH", xpathAppFileUploaderButton);
fileUploader = this.FindControlByXPath(xpathAppFileUploaderButton);
fileUploader.SendKeys(filePath);
问题是,这段代码在IE8中运行良好,但当我移动到IE9(window7)和10(window8)时,没有单击上载按钮。
我使用的是Selenium版本2.44。
提前感谢 该按钮在现场正常工作吗?在IE9和IE10中?是的,当我在IE9和IE10中手动单击时,它是完全正常的。然后它必须在其他浏览器中工作。你有没有收到任何错误?没有,我没有收到任何错误,我成功地获得了具有如下属性的WebElement:selected=false、displayed false、enabled=true、size和location等。我注意到,在IE8中,当我找到upload元素时,它显示的属性是“true”,但在IE9和IE10中它是“false”