我无法在Selenium WebDriver中上传文件

时间:2018-06-25 17:08:18

标签: c# selenium-webdriver

我无法在Selenium Webdriver中上传文件...。  我的代码在这里 ::: driver.FindElement(By.XPath(“ / html / body / div [2] / div [5] / div / div / div / div / div [2] / div [ 2] / div [1] / div / div [1]“))。SendKeys(” E:/ QA / upload test pictures / dreamstime_xl_11004542-Copy.jpg“);

**我遇到错误**:System.InvalidOperationException:'未知错误:无法聚焦元素

1 个答案:

答案 0 :(得分:0)

您不能.SendKeys()到div元素。寻找<input>标签。

相关问题