|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.selenium.remote.service.DriverService
org.openqa.selenium.phantomjs.PhantomJSDriverService
public class PhantomJSDriverService
Service that controls the life-cycle of a PhantomJS in Remote WebDriver mode. The Remote WebDriver is implemented via GhostDriver.
NOTE: Yes, the design of this class is heavily inspired byorg.openqa.selenium.chrome.ChromeDriverService
.
Nested Class Summary | |
---|---|
static class |
PhantomJSDriverService.Builder
Builder used to configure new PhantomJSDriverService instances. |
Field Summary | |
---|---|
static java.lang.String |
PHANTOMJS_EXECUTABLE_PATH_PROPERTY
System property/capability that defines the location of the PhantomJS executable. |
static java.lang.String |
PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY
Optional System property/capability that defines the location of the GhostDriver JavaScript launch file (i.e. |
Method Summary | |
---|---|
static PhantomJSDriverService |
createDefaultService()
Same as createDefaultService(org.openqa.selenium.Capabilities) . |
static PhantomJSDriverService |
createDefaultService(org.openqa.selenium.Capabilities desiredCapabilities)
Configures and returns a new PhantomJSDriverService using the default configuration. |
protected static java.io.File |
findGhostDriver(org.openqa.selenium.Capabilities desiredCapabilities,
java.lang.String docsLink,
java.lang.String downloadLink)
Find the GhostDriver main file (i.e. |
protected static java.io.File |
findPhantomJS(org.openqa.selenium.Capabilities desiredCapabilities,
java.lang.String docsLink,
java.lang.String downloadLink)
Looks into the Capabilities, the current $PATH and the System Properties for PHANTOMJS_EXECUTABLE_PATH_PROPERTY . |
Methods inherited from class org.openqa.selenium.remote.service.DriverService |
---|
checkExecutable, findExecutable, getUrl, isRunning, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PHANTOMJS_EXECUTABLE_PATH_PROPERTY
"phantomjs.binary.path"
.
public static final java.lang.String PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY
"src/main.js"
).
Value: "phantomjs.ghostdriver.path"
.
Method Detail |
---|
public static PhantomJSDriverService createDefaultService(org.openqa.selenium.Capabilities desiredCapabilities)
PhantomJSDriverService
using the default configuration.
In this configuration, the service will use the PhantomJS executable identified by the the
following capability, system property or PATH environment variables:
PHANTOMJS_EXECUTABLE_PATH_PROPERTY
PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY
(Optional - without will use GhostDriver internal to PhantomJS)
public static PhantomJSDriverService createDefaultService()
createDefaultService(org.openqa.selenium.Capabilities)
.
In this case PhantomJS or GhostDriver can't be searched within the Capabilities, only System
Properties.
protected static java.io.File findPhantomJS(org.openqa.selenium.Capabilities desiredCapabilities, java.lang.String docsLink, java.lang.String downloadLink)
PHANTOMJS_EXECUTABLE_PATH_PROPERTY
.
NOTE: If the Capability, the $PATH and the System Property are set, the Capability takes
priority over the System Property, that in turn takes priority over the $PATH.
desiredCapabilities
- Capabilities in which we will look for the path to PhantomJSdocsLink
- The link to the PhantomJS documentation pagedownloadLink
- The link to the PhantomJS download page
File
object
java.lang.IllegalStateException
- If the executable not found or cannot be executedprotected static java.io.File findGhostDriver(org.openqa.selenium.Capabilities desiredCapabilities, java.lang.String docsLink, java.lang.String downloadLink)
"main.js"
).
Looks into the Capabilities and the System Properties for
PHANTOMJS_GHOSTDRIVER_PATH_PROPERTY
.
NOTE: If both the Capability and the System Property are set, the Capability takes priority.
desiredCapabilities
- Capabilities in which we will look for the path to GhostDriverdocsLink
- The link to the GhostDriver documentation pagedownloadLink
- The link to the GhostDriver download page
File
object
java.lang.IllegalStateException
- If the executable not found or cannot be executed
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |