Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java WebDriver可以';t在Firefox4及更高版本上运行测试_Java_Gwt_Selenium_Webdriver_Gxt - Fatal编程技术网

Java WebDriver可以';t在Firefox4及更高版本上运行测试

Java WebDriver可以';t在Firefox4及更高版本上运行测试,java,gwt,selenium,webdriver,gxt,Java,Gwt,Selenium,Webdriver,Gxt,最近我面临一个奇怪的问题。我正在使用WebDriver实现GWT web应用程序的测试自动化。(这是Maven 3项目)我只对Firefox浏览器进行测试。只要我使用Firefox 3.6,一切都正常 每当我尝试使用从FF4到FF8的较新版本的Firefox运行测试时,就会出现问题。每当我运行我的测试时,我得到的都是元素未找到,对于我试图查找、单击、读取的所有内容都是异常的。 使用不同类型的定位器(id、类名、名称)进行任何类型的搜索都会导致: org.openqa.selenium.NoSuc

最近我面临一个奇怪的问题。我正在使用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 -->

4.0.0
网络测试
网络测试
1
硒库
http://selenium.googlecode.com/svn/repository/
朱尼特
朱尼特
4.8.1
测试
org.seleniumhq.selenium
硒爪哇
2.13.0
org.seleniumhq.selenium
硒亲本
2.13.0
聚甲醛
组织协调
和谐
1.4.1
组织协调
协和扩展
1.0.1

当您更新firefox时,可能是函数或类的名称发生了更改,而您忘记了更改


您是否在google Chrome上尝试过您的代码?

当您更新firefox时,可能是因为您忘记更改了函数或类的名称


你在google Chrome上试过你的代码吗?

我建议更新到较新的Selenium-因为浏览器集成紧密WebDriver对ABI的变化很敏感。

我建议更新到较新的Selenium-因为浏览器集成紧密WebDriver对ABI的变化很敏感ABI.

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

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


我们刚刚在我们的集成服务器上安装了3.x版,我们与之共存。

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

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


我们刚刚在我们的集成服务器上安装了3.x版,我们就可以使用它。

我再次尝试了一种稍微不同的方法。但它仍然是一样的,页面启动得很好,每当我试图定位任何元素时,它都会失败,并且没有任何uchelementexception。这在Firefox4.0及更高版本上是相同的,在IE7.8上也是相同的


好吧,我想我还是回到3.6,继续使用它吧:)

我又尝试了一种稍微不同的方法。但它仍然是一样的,页面启动得很好,每当我试图定位任何元素时,它都会失败,并且没有任何uchelementexception。这在Firefox4.0及更高版本上是相同的,在IE7.8上也是相同的


好吧,我想我会回到3.6并继续使用它:)

您尝试过selenium java 2.16.0吗?这可能是巧合,但selenium RC的早期版本(不确定是哪个版本)支持Firefox 3.6。不幸的是,仍然是一样的。您尝试过selenium java 2.16.0吗?这可能是巧合,但是之前版本的Selenium RC(不确定是哪个版本)支持Firefox 3.6。不幸的是,仍然是一样的。我到底应该更新什么?我也用selenium的2.16.1版本尝试了我的代码。我想这是最新的?还是一样。你能为我提供一个适用于你的POM文件示例吗?好的,那么你更新了-我在你的POM中看到了2.13。我现在无法访问我的示例。您确定应用程序中的ID没有更改吗?你有没有试过用Firebug运行Firefox,让应用程序等待很长时间,然后检查DOM?我今天又试了一次,现在即使在谷歌网站上,我也永远不会有任何例外。非常简单的代码片段:@Test public void shouldOpenGoogle(){WebDriver WebDriver=new FirefoxDriver();WebDriver.get(“);WebDriver.findelelement(By.name(“q”);WebDriver.findelelement(By.id(“searchText”)).sendKeys(“asd”);}我到底应该更新什么?我用selenium的2.16.1版本尝试了我的代码。我认为这是最新的版本?还是一样的。你能给我提供一个适用于你的POM文件示例吗?好的,所以你更新了-我在你的POM中看到了2.13。我现在无法访问我的示例。你确定你的应用程序中的ID没有改变吗?你尝试运行了吗Firefox和Firebug,将应用程序放入长时间等待并检查DOM?我今天再次尝试,现在即使在谷歌网站上,我也得到了永久性的NoTouchElementException。非常简单的代码片段:@Test public void shouldOpenGoogle(){WebDriver WebDriver=new FirefoxDriver();WebDriver.get(“);webDriver.findElement(By.name(“q”);webDriver.findElement(By.id(“searchText”))).sendKeys(“asd”);}Thx对于答案,似乎不仅我有这个问题Thx对于答案,似乎不仅我有这个问题