public final class AppiumServiceBuilder extends org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPIUM_PATH
The environmental variable used to define
the path to executable appium.js (1.4.x and lower) or
main.js (1.5.x and higher).
|
static int |
DEFAULT_APPIUM_PORT |
static java.lang.String |
DEFAULT_LOCAL_IP_ADDRESS |
static java.lang.String |
NODE_PATH
The environmental variable used to define
the path to executable NodeJS file (node.exe for WIN and
node for Linux/MacOS X).
|
Constructor and Description |
---|
AppiumServiceBuilder() |
Modifier and Type | Method and Description |
---|---|
protected com.google.common.collect.ImmutableList<java.lang.String> |
createArgs() |
protected AppiumDriverLocalService |
createDriverService(java.io.File nodeJSExecutable,
int nodeJSPort,
com.google.common.collect.ImmutableList<java.lang.String> nodeArguments,
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> nodeEnvironment) |
protected void |
finalize() |
protected java.io.File |
findDefaultExecutable() |
AppiumServiceBuilder |
usingAnyFreePort()
Configures the appium server to start on any available port.
|
AppiumServiceBuilder |
usingDriverExecutable(java.io.File nodeJSExecutable)
Sets which Node.js the builder will use.
|
AppiumServiceBuilder |
usingPort(int port)
Sets which port the appium server should be started on.
|
AppiumServiceBuilder |
withAppiumJS(java.io.File appiumJS)
Sets an executable appium.js.
|
AppiumServiceBuilder |
withArgument(ServerArgument argument)
Boolean arguments have a special moment:
the presence of an arguments means "true".
|
AppiumServiceBuilder |
withArgument(ServerArgument argument,
java.lang.String value)
Adds a server argument.
|
AppiumServiceBuilder |
withCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities)
Adds a desired capabilities.
|
AppiumServiceBuilder |
withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
Defines the environment for the launched appium server.
|
AppiumServiceBuilder |
withIPAddress(java.lang.String ipAddress) |
AppiumServiceBuilder |
withLogFile(java.io.File logFile)
Configures the appium server to write log to the given file.
|
AppiumServiceBuilder |
withStartUpTimeOut(long time,
java.util.concurrent.TimeUnit timeUnit)
Sets start up timeout.
|
public static final java.lang.String APPIUM_PATH
public static final java.lang.String NODE_PATH
public static final java.lang.String DEFAULT_LOCAL_IP_ADDRESS
public static final int DEFAULT_APPIUM_PORT
protected java.io.File findDefaultExecutable()
findDefaultExecutable
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
public AppiumServiceBuilder withArgument(ServerArgument argument)
argument
- is an instance which contains the argument name.public AppiumServiceBuilder withArgument(ServerArgument argument, java.lang.String value)
argument
- is an instance which contains the argument name.value
- A non null string value. (Warn!!!) Boolean arguments have a special moment:
the presence of an arguments means "true". At this case an empty string
should be defined.public AppiumServiceBuilder withCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities)
capabilities
- is an instance of DesiredCapabilities
.public AppiumServiceBuilder withAppiumJS(java.io.File appiumJS)
appiumJS
- an executable appium.js (1.4.x and lower) or
main.js (1.5.x and higher).public AppiumServiceBuilder withIPAddress(java.lang.String ipAddress)
public AppiumServiceBuilder withStartUpTimeOut(long time, java.util.concurrent.TimeUnit timeUnit)
time
- a time value for the service starting up.timeUnit
- a time unit for the service starting up.protected com.google.common.collect.ImmutableList<java.lang.String> createArgs()
createArgs
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
public AppiumServiceBuilder usingDriverExecutable(java.io.File nodeJSExecutable)
usingDriverExecutable
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
nodeJSExecutable
- The executable Node.js to use.public AppiumServiceBuilder usingPort(int port)
usingPort
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
port
- The port to use; must be non-negative.public AppiumServiceBuilder usingAnyFreePort()
usingAnyFreePort
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
public AppiumServiceBuilder withEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
withEnvironment
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
environment
- A map of the environment variables to launch the
appium server with.public AppiumServiceBuilder withLogFile(java.io.File logFile)
withLogFile
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
logFile
- A file to write log to.protected AppiumDriverLocalService createDriverService(java.io.File nodeJSExecutable, int nodeJSPort, com.google.common.collect.ImmutableList<java.lang.String> nodeArguments, com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> nodeEnvironment)
createDriverService
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable