-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseNg.java
31 lines (29 loc) · 1007 Bytes
/
baseNg.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
package org.testingNG;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.testng.annotations.*;
public class baseNg {
protected WebDriver driver;
@Parameters(value = "Browser")
@BeforeClass
public void setUp(String Browser){
if(Browser.equalsIgnoreCase("chrome")){
System.setProperty("webdriver.chrome.driver", "/Users/sarthakrana/Desktop/IDE/basic/git/src/main/resources/chromedriver");
driver = new ChromeDriver();
}
else if (Browser.equals("safari")){
System.setProperty("webdriver.safari.driver", "/usr/bin/safaridriver");
driver = new SafariDriver();
}
else{
System.err.println("Error");
}
driver.manage().window().maximize();
driver.get("https://ecommerce-playground.lambdatest.io");
}
@AfterClass
public void terminate(){
driver.quit();
}
}