Search code examples
grailsseleniumgebselenium-chromedriver

Selenium exception when using chrome driver


While doing same testing with Geb in a Grails application, the tests passed when runned with default's HtmlUnitDriver.

But, when I changed to ChromeDriver, I was receiving

org.openqa.selenium.InvalidElementStateException: Element is not currently interactable and may not be manipulated

when testing the login page.

The exception was thrown immediately after setting the emailField (selected through its id '#username'). The strange thing was that I was seeing the browser setting the value on the field, but after that (and before executing the following line of the code) it throwed the Exception.


Solution

  • I noticed that the login page had 2 elements with id="username" (one of which was a hidden field), and that was the reason of the exception. When I changed the id of the login page to another value (and updated the selector), the problem was solved.