gpt4 book ai didi

java - 无法使用 Arquillian Drone 连接到 Firefox

转载 作者:行者123 更新时间:2023-11-30 07:54:26 24 4
gpt4 key购买 nike

我正在关注位于 here 的文档.我的目标是将 Drone 集成到我的客户端测试中。

这是我的代码示例:

@Test
@RunAsClient
public void testSomething(@Drone final FirefoxDriver driver) throws Exception {
final String url = "www.google.com";
System.out.println("### the endpoint is :: " + url);

driver.get(url);
driver.wait(5000);
final String pageSource = driver.getPageSource();
System.out.println("### source is :: " + pageSource);

}

当我运行我的 Arquillain 测试时,一个 firefox 窗口确实会打开,但它只是停在那里。一段时间后,我的测试超时,并给我以下困惑:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
*** Blocklist::_preloadBlocklistFile: blocklist is disabled
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 677: aUrl is undefined
JavaScript error: chrome://browser/content/urlbarBindings.xml, line 677: aUrl is undefined

我在 Firefox 32 和 45 上试过,结果相同。我对selenium的依赖结构如下:

selenium-firefox-驱动程序:2.29.0

Selenium 远程驱动程序:2.29.0

arquillian-drone-webdriver-depchain:1.1.1.Final

我在这里错过了什么?

最佳答案

Firefox 32、45 已经很老了。

你似乎指的是一些关于 Arquillian Drone 的旧文档。

查看此新文档 - http://arquillian.org/arquillian-extension-drone/

检查我的 pom,它工作得很好,并相应地调整你的。

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<version.org.jboss.arquillian>1.1.12.Final</version.org.jboss.arquillian>
<version.org.jboss.arquillian.drone>2.1.0.Alpha2</version.org.jboss.arquillian.drone>
</properties>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver</artifactId>
<version>2.2.0</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.testng</groupId>
<artifactId>arquillian-testng-standalone</artifactId>
<version>1.1.13.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-api</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.graphene</groupId>
<artifactId>graphene-webdriver-api</artifactId>
<version>2.2.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<!-- Arquillian Core dependencies -->
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>${version.org.jboss.arquillian}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Arquillian Drone dependencies and WebDriver/Selenium dependencies -->
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-drone-bom</artifactId>
<version>${version.org.jboss.arquillian.drone}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

关于java - 无法使用 Arquillian Drone 连接到 Firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44037397/

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