gpt4 book ai didi

java - WebDriver 无法在 Firefox 4 及更高版本上运行测试

转载 作者:太空宇宙 更新时间:2023-11-04 08:25:38 24 4
gpt4 key购买 nike

最近我遇到了一个奇怪的问题。我正在使用 WebDriver 进行 GWT Web 应用程序的测试自动化。 (这是 Maven 3 项目)我只对 Firefox 浏览器执行测试。只要我使用 Firefox 3.6,一切都正常

每当我尝试使用从 FF4 到 FF8 的较新版本的 Firefox 运行测试时,就会出现问题。每当我运行测试时,我得到的都是元素未找到异常,对于我尝试查找、单击、读取等的所有内容。使用不同类型的定位器(id、类名、名称)进行任何类型的搜索都会导致:

org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method":"id","selector":"SOME_ID"}; duration or timeout: 31 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
...
Driver info: driver.version: RemoteWebDriver

更重要的是,它只发生在我的应用程序中,因为当我编写一个快速测试来访问 google.com 并搜索一些内容时,一切都运行良好。

有人遇到过类似的问题吗?我的网络应用程序有问题吗?也许我应该在某个地方改变一些东西?我只是不知道什么以及在哪里?也许较新的 Firefox 需要一些 gwt 应用程序配置文件?如果有任何帮助的话,这是我的 POM 文件:

 <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>WebTests</groupId>
<artifactId>WebTests</artifactId>
<version>1.0</version>

<!--START:repositories -->
<repositories>
<repository>
<id>selenium-repository</id>
<url>http://selenium.googlecode.com/svn/repository/</url>
</repository>
</repositories>
<!--END:repositories -->

<!--START:dependencies -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.13.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-parent</artifactId>
<version>2.13.0</version>
<type>POM</type>
</dependency>

<dependency>
<groupId>org.concordion</groupId>
<artifactId>concordion</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.concordion</groupId>
<artifactId>concordion-extensions</artifactId>
<version>1.0.1</version>
</dependency>

</dependencies>
<!--END:dependencies -->

最佳答案

我们在项目中遇到了同样的问题,也像您一样使用 Maven 等。

我尝试了几个 Firefox 版本,但似乎最新版本的 selenium 也不支持 3.x 以上的 Firefox

我们刚刚在集成服务器上安装了 3.x 版本,并且可以接受它。

关于java - WebDriver 无法在 Firefox 4 及更高版本上运行测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8600773/

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