Using chrome driver headless to run jasmine tests

424 views
Skip to first unread message

your...@gmail.com

unread,
Nov 27, 2017, 3:35:52 PM11/27/17
to headless-dev
Hi,

We are running jasmine tests using google chrome driver (headless). We just switched from phantomjs. We are able to execute tests if we set up the chrome driver binary path when we run mvn as below:

$ mvn -Dwebdriver.chrome.driver=src/test/resources/chromedriver.exe

But we want to set up the above property in pom.xml (either in jasmine plugin configuration or maven surefire plugin). But no luck :-(
We tried the following:
<configuration>
    <systemPropertyVariables>
        <webdriver.chrome.driver>${project.basedir}/src/test/resources/chromedriver.exe</webdriver.chrome.driver>
    </systemPropertyVariables>
</configuration>

<configuration>
    <systemPropertyVariables>
        <webdriver.chrome.driver>src/test/resources/chromedriver.exe</webdriver.chrome.driver>
    </systemPropertyVariables>
</configuration>

<configuration>
    <argLine>-Dwebdriver.chrome.driver=src/test/resources/chromedriver.exe
</configuration>

<configuration>
    <jvmArguments>
        -Dwebdriver.chrome.driver=src/test/resources/chromedriver.exe
</jvmArguments> </configuration>

Also setting up a property in <properties> section and then refer it in plug ins. None of the above options helps. We always get the following error:

[ERROR] Failed to execute goal com.github.searls:jasmine-maven-plugin:2.1:test (default) on project connect: The jasmine-maven-plugin encountered an exception:
[ERROR] java.lang.reflect.InvocationTargetException
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[ERROR] 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.googleapis.com/index.html
[ERROR] at com.google.common.base.Preconditions.checkState(Preconditions.java:197)


Please advise what we are doing wrong and how to set up chrome binary path in pom.xml.

Sami Kyostila

unread,
Nov 28, 2017, 6:25:48 AM11/28/17
to your...@gmail.com, headless-dev
This sounds like a better question for the Jasmine mailing list.

- Sami

--
You received this message because you are subscribed to the Google Groups "headless-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to headless-dev...@chromium.org.
To post to this group, send email to headle...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/headless-dev/804d2086-2a1c-48f8-a2a8-72efd17233f8%40chromium.org.
Reply all
Reply to author
Forward
0 new messages