Element after jquery.show and WebDriverException: unknown error: cannot focus element Element after jquery.show and WebDriverException: unknown error: cannot focus element selenium selenium

Element after jquery.show and WebDriverException: unknown error: cannot focus element


After some hours I finally found a solution by using Actions without JavascriptExecuter:

Actions actions = new Actions(driver);actions.moveToElement(website);actions.click();actions.sendKeys("Some Name");actions.build().perform();

Well, it worked for me. However, is this way the better solution ?


A bit late to the party, but those looking for a solution to this problem while using selenium under python can use the following code:

actions = webdriver.ActionChains(driver)actions.move_to_element(my_div)actions.click()actions.send_keys("Some name") # Replace with whichever keys you want.actions.perform()

Where my_div is an element you've previously selected, perhaps with code like this:

my_div = item.find_element_by_css_selector("div.foobar")


On the similar lines if you are using protractor (angularjs) you can use it this way `

actions = protractor.getInstance().actions();actions.mouseMove(element);actions.click();actions.sendKeys("Some text");actions.perform();`