I have been trying to use Selenium sendkeys() without success using
Chrome. I've researched similar questions here that seemed related
without success. I can spawn the URL, invoke buttons (click()) but when I
attempt to enter a value within a specific text field I get:
"Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element."
Would appreciate any help. Thank you!
Here's a snippet of my code:
WebElement titleBox = driver.findElement(By.xpath("//*[@id='root']/div/div[2]/div/div/div[2]/div[1]"));
//titleBox.click();
//titleBox.sendKeys("Test Title");
Actions action = new Actions(driver);
action.moveToElement(titleBox).click();
titleBox.sendKeys("Test Title");
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot focus element
(Session info: chrome=58.0.3029.110)
(Driver info: chromedriver=2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b),platform=Mac OS X 10.12.5 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 45 milliseconds