Class AppiumServiceBuilder
java.lang.Object
org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
io.appium.java_client.service.local.AppiumServiceBuilder
public final class AppiumServiceBuilder
extends org.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe 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 final Stringstatic final Stringstatic final intstatic final StringSystem property and environment variable name for the Node.js executable path (node.exe on Windows, node on Linux/macOS).Fields inherited from class org.openqa.selenium.remote.service.DriverService.Builder
exe -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AppiumDriverLocalServicecreateDriverService(File nodeJSExecutable, int nodeJSPort, Duration startupTimeout, List<String> nodeArguments, Map<String, String> nodeEnvironment) protected Fileprotected voidintscore(org.openqa.selenium.Capabilities capabilities) Provides a measure of how strongly thisDriverServicesupports the givencapabilities.Configures the appium server to start on any available port.usingDriverExecutable(File nodeJSExecutable) Sets which Node.js the builder will use.usingPort(int port) Sets which port the appium server should be started on.withAppiumJS(File appiumJS) Sets an executable appium.js.withArgument(ServerArgument argument) Boolean arguments have a special moment: the presence of an arguments means "true".withArgument(ServerArgument argument, String value) Adds a server argument.withCapabilities(org.openqa.selenium.Capabilities capabilities) Adds capabilities.withCapabilities(org.openqa.selenium.Capabilities capabilities, boolean autoQuoteCapabilitiesOnWindows) Adds capabilities.withEnvironment(Map<String, String> environment) Defines the environment for the launched appium server.withIPAddress(String ipAddress) withLogFile(File logFile) Configures the appium server to write log to the given file.Methods inherited from class org.openqa.selenium.remote.service.DriverService.Builder
build, getDefaultTimeout, getLogFile, getLogOutput, getPort, parseLogOutput, withLogOutput, withTimeout
-
Field Details
-
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).- See Also:
-
NODE_PATH
System property and environment variable name for the Node.js executable path (node.exe on Windows, node on Linux/macOS).- See Also:
-
BROADCAST_IP4_ADDRESS
- See Also:
-
BROADCAST_IP6_ADDRESS
- See Also:
-
DEFAULT_APPIUM_PORT
public static final int DEFAULT_APPIUM_PORT- See Also:
-
-
Constructor Details
-
AppiumServiceBuilder
public AppiumServiceBuilder()
-
-
Method Details
-
score
public int score(org.openqa.selenium.Capabilities capabilities) Provides a measure of how strongly thisDriverServicesupports the givencapabilities. A score of 0 or less indicates that thisDriverServicedoes not support instances ofWebDriverthat requirecapabilities. Typically, the score is generated by summing the number of capabilities that the driver service directly supports that are unique to the driver service (that is, things like "proxy" don't tend to count to the score). Higher the score, higher the possibility of getting grid sessions created sooner.- Specified by:
scorein classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
-
findDefaultExecutable
-
withArgument
Boolean arguments have a special moment: the presence of an arguments means "true". This method was designed for these cases.- Parameters:
argument- is an instance which contains the argument name.- Returns:
- the self-reference.
-
withArgument
Adds a server argument.- Parameters:
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.- Returns:
- the self-reference.
-
withCapabilities
Adds capabilities.- Parameters:
capabilities- is an instance ofCapabilities.- Returns:
- the self-reference.
-
withCapabilities
public AppiumServiceBuilder withCapabilities(org.openqa.selenium.Capabilities capabilities, boolean autoQuoteCapabilitiesOnWindows) Adds capabilities.- Parameters:
capabilities- is an instance ofCapabilities.autoQuoteCapabilitiesOnWindows- automatically escape quote all capabilities when calling appium. This is required on windows systems only.- Returns:
- the self-reference.
-
withAppiumJS
Sets an executable appium.js.- Parameters:
appiumJS- an executable appium.js (1.4.x and lower) or main.js (1.5.x and higher).- Returns:
- the self-reference.
-
withIPAddress
-
createArgs
- Specified by:
createArgsin classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
-
loadSystemProperties
protected void loadSystemProperties()- Specified by:
loadSystemPropertiesin classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
-
usingDriverExecutable
Sets which Node.js the builder will use.- Overrides:
usingDriverExecutablein classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder> - Parameters:
nodeJSExecutable- The executable Node.js to use.- Returns:
- A self reference.
-
usingPort
Sets which port the appium server should be started on. A value of 0 indicates that any free port may be used.- Overrides:
usingPortin classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder> - Parameters:
port- The port to use; must be non-negative.- Returns:
- A self reference.
-
usingAnyFreePort
Configures the appium server to start on any available port.- Overrides:
usingAnyFreePortin classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder> - Returns:
- A self reference.
-
withEnvironment
Defines the environment for the launched appium server.- Overrides:
withEnvironmentin classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder> - Parameters:
environment- A map of the environment variables to launch the appium server with.- Returns:
- A self reference.
-
withLogFile
Configures the appium server to write log to the given file.- Overrides:
withLogFilein classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder> - Parameters:
logFile- A file to write log to.- Returns:
- A self reference.
-
createDriverService
protected AppiumDriverLocalService createDriverService(File nodeJSExecutable, int nodeJSPort, Duration startupTimeout, List<String> nodeArguments, Map<String, String> nodeEnvironment) - Specified by:
createDriverServicein classorg.openqa.selenium.remote.service.DriverService.Builder<AppiumDriverLocalService,AppiumServiceBuilder>
-