Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.mytests.uiobjects.example.grid;
- import java.net.MalformedURLException;
- import java.net.URL;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.remote.DesiredCapabilities;
- import org.openqa.selenium.remote.RemoteWebDriver;
- public class RemoteDriverManager {
- public static WebDriver getRemoteDriver(String url, String driverType) {
- RemoteWebDriver remote = null;
- try {
- DesiredCapabilities caps = new DesiredCapabilities();
- caps.setBrowserName(driverType);
- remote = new RemoteWebDriver(new URL(url), caps);
- } catch (MalformedURLException e) {
- System.out.println("Can't init remote driver: "+e.getMessage());
- }
- return remote;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement