-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriverSetup.java
More file actions
32 lines (22 loc) · 801 Bytes
/
Copy pathDriverSetup.java
File metadata and controls
32 lines (22 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package config;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.manager.SeleniumManager;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class DriverSetup {
public WebDriver getLocalDriver() {
SeleniumManager.getInstance();
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
return driver;
}
public WebDriver getRemoteDriver(String browser) throws MalformedURLException {
DesiredCapabilities dc = new DesiredCapabilities();
dc.setBrowserName(browser);
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc);
return driver;
}
}