Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

seleniumQuery and PhantomJS Driver

Antônio "acdc" Jr edited this page Mar 1, 2017 · 2 revisions

This page should contain instructions about how to use PhantomJS with seleniumQuery.

To set PhantomJS as driver in seleniumQuery:

// will look for phantomjs.exe at the classpath; at 
// the "phantomjs.binary.path" system property or at the system PATH
$.driver().usePhantomJS();

or

// will look for the executable server in the given path. Path can be relative.
String phantomJsPath = "C:\\myFiles\\phantomjs_evenRenamed.exe";
$.driver().usePhantomJS().withPathToPhantomJsExe(phantomJsPath );

Error:

java.lang.NoClassDefFoundError: Could not initialize class org.openqa.selenium.os.Kernel32

and

java.lang.UnsatisfiedLinkError: Can't obtain updateLastError method for class com.sun.jna.Native

Solution based on: http://stackoverflow.com/a/21679005/1850609

Simply added to maven command-line: -Djna.nosys=true

So, if it was:

mvn clean test

Now it is:

mvn clean test -Djna.nosys=true

Clone this wiki locally

Morty Proxy This is a proxified and sanitized view of the page, visit original site.