Reputation: 9
I am not able to upload files in selenium webdriver .... My code is here: : driver.FindElement(By.XPath("/html/body/div[2]/div[5]/div/div/div/div[2]/div[2]/div[1]/div/div[1]")).SendKeys ("E:/QA/upload test pictures/dreamstime_xl_11004542-Copy.jpg");
**I am getting error ** : System.InvalidOperationException: 'unknown error: cannot focus element
Upvotes: 0
Views: 605
Reputation: 1806
You can't .SendKeys() to a div element. Look for the <input>
tag instead.
Upvotes: 0