jboss-arquillian - 如何将 Arquillian Graphene 2 与 ChromeDriver 结合使用

标签 jboss-arquillian arquillian-drone graphene2

如何在不同的浏览器(例如 Chrome)中使用 Graphene 2? (默认的 htmlUnit 对我来说效果不佳。)

在 Arquillian 容器内运行 Wildfly 8.1 服务器,我想使用 Drone + Graphene 来执行实际测试。

@Drone
WebDriverdriver;

...

@RunAsClient
@Test
@InSequence(1)
public void basicHomepageTest() {

    // try to get the homepage
    driver.get("http://localhost:8080/superapp");

    // read title and source
    Assert.assertEquals("My Super App", driver.getTitle());

    // read content
    System.out.println("Page source -----");
    System.out.println(driver.getPageSource());
}

我尝试将其添加到 arquillian.xml 配置中(但没有成功):

<extension qualifier="webdriver">
    <property name="browser">chrome</property>
</extension>

最终结果是:

java.lang.RuntimeException: Unable to instantiate Drone via org.openqa.selenium.chrome.ChromeDriver(Capabilities): java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/se
    lenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html
    Caused by: java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleap
    is.com/index.html

我真的需要以某种方式将 Chrome 二进制文件嵌入到我的项目中吗?

最佳答案

您不必将其嵌入到您的项目本身中,但 Chrome 的驱动程序并不随浏览器本身一起提供。您必须下载它并在配置文件中使用 chromeDriverBinary 将 Graphene 指向其位置。

关于jboss-arquillian - 如何将 Arquillian Graphene 2 与 ChromeDriver 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38869640/

相关文章:

cloud - 在远程云服务器上安装的 jboss 上运行 arquillian 测试

java - 执行错误 : org. infinispan.util.concurrent.TimeoutException:ISPN000299:10 秒后无法获取 key 的锁

java - 在 Arquillian Drone 扩展中使用 BrowserMob 代理时 HAR 不完整

java - Arquillain/Shrinkwrap 如何添加整个 META-INF 目录?

docker - 在 Docker 中配置 Wildfly,以便 Arquillian 可以部署到它

java - 使用 SolrServer 时 Bean 未注入(inject) CDI 和 Arquillian 测试失败

user-interface - 我如何通过浏览器从测试到使用 Arquillian Drone 和 Graphene 进行测试

selenium - 是否可以在不使用 Arquillian 容器管理和部署的情况下使用 Arquillian Graphene?

java - 我如何告诉 Graphene 加载我的@Page?

java - 如何在 Arquillian 功能测试中创建 Payara 用户帐户?