-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartUp.java
39 lines (33 loc) · 1.55 KB
/
startUp.java
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
33
34
35
36
37
38
package browserSetup;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class startUp {
public static void setFirefoxBrowser() {
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Love\\Documents\\SeleniumTest\\lib\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
public static void setChromeBrowser() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Love\\Documents\\SeleniumTest\\lib\\chromedriver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().window().maximize();
}
public static void openChromeBrowser(String baseurl) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Love\\Documents\\SeleniumTest\\lib\\chromedriver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get(baseurl);
}
public static void openFirefoxBrowser(String baseurl) {
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Love\\Documents\\SeleniumTest\\lib\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get(baseurl);
}
}