grails - 使用Chrome驱动程序时出现 Selenium 异常

标签 grails selenium geb selenium-chromedriver

在Grails应用程序中使用Geb进行相同的测试时,使用默认的HtmlUnitDriver运行时,测试通过了。

但是,当我更改为ChromeDriver时,我收到了

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



在测试登录页面时。

设置emailField(通过其ID'#username'选择)后立即引发异常。奇怪的是,我看到浏览器在该字段上设置了值,但是在那之后(执行下面的代码行之前)它抛出了Exception。

最佳答案

我注意到登录页面上有2个元素的ID为“=“用户名”(其中一个是隐藏字段),这就是异常(exception)的原因。当我将登录页面的ID更改为另一个值(并更新了选择器)时,问题已解决。

关于grails - 使用Chrome驱动程序时出现 Selenium 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13465683/

相关文章:

grails - 如何从Grails Controller 重定向到相对URL

angularjs - Selenium webdriver 如何获取 angularjs Li 元素的启用状态

ruby-on-rails - Selenium rails 测试中的 Chromedriver 错误

android - 为移动应用学习 geb 和 Spock

grails - 在grails中的多对多关系中使用复选框

spring - 如何在运行时检查资源文件是否存在[grails]?

Grails 未加载 .jar 文件中的类

java - 如何将一个独立项目添加到另一个maven项目中

testing - Geb。访问头部元素内容(脚本/样式表/标题...)

testing - geb.error.RequiredPageContentNotPresent : The required page content 'loginButton is not present