2016-08-10 3 views
2

Chrome과 같은 다른 브라우저에서 어떻게 Graphene 2를 사용합니까? (기본 htmlUnit이 제대로 작동하지 않습니다.)Arquillian Graphene 2를 ChromeDriver와 함께 사용하는 방법

Arquillian 컨테이너에서 Wildfly 8.1 서버를 실행하면 Drone + Graphene을 사용하여 실제 테스트를 수행하고 싶습니다.

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

는 함께 종료 :

@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을 추가하는 시도

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 

정말에 크롬 바이너리를 포함해야합니까 내 어떻게 든 프로젝트?

+0

을 arquillian.xml 이진에 경로를 추가 Arquillinan Graphene에 대한 자세한 정보 : http://www.testautomationguru.com/selenium-webdriver-automation-using-arquillian-framework/ – vins

답변

3

프로젝트 자체에 퍼가기는하지 않지만 Chrome 용 드라이버는 브라우저와 함께 제공되지 않습니다. 이 파일을 다운로드하고 설정 파일에 chromeDriverBinary을 사용하여 Graphene을 해당 위치로 지정해야합니다.

2

그냥 bartozs의 답변을 보완하기 위해, 여기에 내가 무슨 짓을 :

1) 내 OS에 대한 chromedriver 바이너리를 다운로드 here

2)에 대한

<extension qualifier="webdriver"> 
    <property name="browser">chrome</property> 
    <property name="chromeDriverBinary">webdriver-bin/chrome/chromedriver.exe</property> 
</extension> 
+0

또한 시스템/사용자 환경 경로에 넣을 수 있으므로 하드 코드 할 필요가 없습니다 특정 경로. –

관련 문제