public class WiniumDriverService
extends org.openqa.selenium.remote.service.DriverService
import static org.junit.Assert.assertEquals;
import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.openqa.selenium.winium.WiniumDriver;
import org.openqa.selenium.winium.WiniumDriverService;
import org.openqa.selenium.winium.DesktopOptions;
{@literal @RunWith(JUnit4.class)}
public class WiniumTest extends TestCase {
private static WiniumDriverService service;
private WebDriver driver;
{@literal @BeforeClass}
public static void createAndStartService() {
service = new WiniumDriverService.Builder()
.usingDriverExecutable("path_to_driver_executable")
.usingAnyFreePort()
.withVerbose(true)
.withSilent(false);
.buildDesktopService();
service.start();
}
{@literal @AfterClass}
public static void createAndStopService() {
service.stop();
}
{@literal @Before}
public void createDriver() {
DesktopOptions options = DesktopOptions();
options.setApplicationPath("C:\\Windows\\System32\\notepad.exe");
driver = new WiniumDriver(service, options);
}
{@literal @After}
public void quitDriver() {
driver.quit();
}
{@literal @Test}
public void testSomething() {
// Rest of test
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
WiniumDriverService.Builder |
| Modifier and Type | Field and Description |
|---|---|
static String |
WINIUM_DRIVER_LOG_PATH_PROPERTY
System property that defines the location of the log that will be written by service
|
static String |
WINIUM_DRIVER_SILENT
Boolean system property that defines whether the WiniumDriver executable should be started
without any output.
|
static String |
WINIUM_DRIVER_VERBOSE_LOG
Boolean system property that defines whether the WiniumDriver executable should be started
with verbose logging.
|
| Modifier | Constructor and Description |
|---|---|
protected |
WiniumDriverService(File executable,
int port,
com.google.common.collect.ImmutableList<String> args,
com.google.common.collect.ImmutableMap<String,String> environment) |
| Modifier and Type | Method and Description |
|---|---|
static WiniumDriverService |
createDesktopService()
Creates a default instance of the WiniumDriverService using a default path to the Winium Desktop Driver.
|
static WiniumDriverService |
createSilverlightService()
Creates a default instance of the WiniumDriverService using a default path to the Winium WindowsPhone Driver.
|
static WiniumDriverService |
createStoreAppsService()
Creates a default instance of the WiniumDriverService using a default path to the Winium StoreApps Driver.
|
public static final String WINIUM_DRIVER_VERBOSE_LOG
public static final String WINIUM_DRIVER_SILENT
public static final String WINIUM_DRIVER_LOG_PATH_PROPERTY
protected WiniumDriverService(File executable, int port, com.google.common.collect.ImmutableList<String> args, com.google.common.collect.ImmutableMap<String,String> environment) throws IOException
IOExceptionpublic static WiniumDriverService createDesktopService()
WiniumDriverService using Winium Desktop and random portpublic static WiniumDriverService createSilverlightService()
WiniumDriverService using Winium WindowsPhone and random portpublic static WiniumDriverService createStoreAppsService()
WiniumDriverService using Winium StoreApps and random portCopyright © 2015. All rights reserved.