public final class AppiumServiceBuilder extends org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
Modifier and Type | Field and Description |
---|---|
static 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 String |
DEFAULT_LOCAL_IP_ADDRESS |
static 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<String> |
createArgs() |
protected AppiumDriverLocalService |
createDriverService(File nodeJSExecutable,
int nodeJSPort,
com.google.common.collect.ImmutableList<String> nodeArguments,
com.google.common.collect.ImmutableMap<String,String> nodeEnvironment) |
protected void |
finalize() |
protected File |
findDefaultExecutable() |
AppiumServiceBuilder |
usingAnyFreePort()
Configures the appium server to start on any available port.
|
AppiumServiceBuilder |
usingDriverExecutable(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(File appiumJS) |
AppiumServiceBuilder |
withArgument(ServerArgument argument)
Boolean arguments have a special moment:
the presence of an arguments means "true".
|
AppiumServiceBuilder |
withArgument(ServerArgument argument,
String value) |
AppiumServiceBuilder |
withCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities) |
AppiumServiceBuilder |
withEnvironment(Map<String,String> environment)
Defines the environment for the launched appium server.
|
AppiumServiceBuilder |
withIPAddress(String ipAddress) |
AppiumServiceBuilder |
withLogFile(File logFile)
Configures the appium server to write log to the given file.
|
AppiumServiceBuilder |
withStartUpTimeOut(long time,
TimeUnit timeUnit) |
public static final String APPIUM_PATH
public static final String NODE_PATH
public static final String DEFAULT_LOCAL_IP_ADDRESS
protected 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 namepublic AppiumServiceBuilder withArgument(ServerArgument argument, String value)
argument
- is an instance which contains the argument namevalue
- 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 definedpublic AppiumServiceBuilder withCapabilities(org.openqa.selenium.remote.DesiredCapabilities capabilities)
capabilities
- is an instance of DesiredCapabilities
public AppiumServiceBuilder withAppiumJS(File appiumJS)
appiumJS
- an executable appium.js (1.4.x and lower) or
main.js (1.5.x and higher)public AppiumServiceBuilder withIPAddress(String ipAddress)
public AppiumServiceBuilder withStartUpTimeOut(long time, TimeUnit timeUnit)
time
- a time value for the service starting uptimeUnit
- a time unit for the service starting upprotected com.google.common.collect.ImmutableList<String> createArgs()
createArgs
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
public AppiumServiceBuilder usingDriverExecutable(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(Map<String,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(File logFile)
withLogFile
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
logFile
- A file to write log to.protected AppiumDriverLocalService createDriverService(File nodeJSExecutable, int nodeJSPort, com.google.common.collect.ImmutableList<String> nodeArguments, com.google.common.collect.ImmutableMap<String,String> nodeEnvironment)
createDriverService
in class org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
Copyright © 2016. All rights reserved.