Skip to content

Instantly share code, notes, and snippets.

@borodicht
Created December 18, 2024 17:13
Show Gist options
  • Save borodicht/1f1f85ad35fcc9406b57994fa2a3d8df to your computer and use it in GitHub Desktop.
Save borodicht/1f1f85ad35fcc9406b57994fa2a3d8df to your computer and use it in GitHub Desktop.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import java.time.Duration;
public class BaseTest {
WebDriver driver;
@BeforeMethod
public void setup() {
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20));
driver.get("https://www.saucedemo.com/");
}
@AfterMethod(alwaysRun = true)
public void close() {
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment