gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 14:25:51 26 4
gpt4 key购买 nike

在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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com