Example usage for org.openqa.selenium.remote.service DriverService start

List of usage examples for org.openqa.selenium.remote.service DriverService start

Introduction

In this page you can find the example usage for org.openqa.selenium.remote.service DriverService start.

Prototype

public void start() throws IOException 

Source Link

Document

Starts this service if it is not already running.

Usage

From source file:com.comcast.dawg.selenium.BrowserServiceManager.java

License:Apache License

/**
 * Starts a selenium service for a given browser
 * @param browser The browser to start the service for
 * @return/* w  w  w  .  j ava 2s  . co  m*/
 * @throws IOException
 */
public static DriverService start(Browser browser) throws IOException {
    BrowserDriverProvider provider = getProvider(browser);
    DriverService service = new ChromeDriverService.Builder().usingDriverExecutable(provider.getDriverFile())
            .usingAnyFreePort().build();
    service.start();
    return service;
}