我正在关注位于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-firefox驱动程序:2.29.0
硒遥控驱动器: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/