Skip to content

Instantly share code, notes, and snippets.

@NickBaynham
Created March 3, 2020 15:36
Show Gist options
  • Save NickBaynham/ee2820e09a1e67e5aa69c8e273136f40 to your computer and use it in GitHub Desktop.
Save NickBaynham/ee2820e09a1e67e5aa69c8e273136f40 to your computer and use it in GitHub Desktop.
Registration Base Test
package selfHealingExamples.tests.registration;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
public class BaseTest {
@BeforeMethod
public void setup() {
System.setProperty("webdriver.chrome.driver", "/Selenium/chromedriver");
driver.set(new ChromeDriver());
}
@AfterMethod
public void wrapUp() {
if (driver.get() != null) {
driver.get().quit();
}
}
WebDriver getDriver() {
return driver.get();
}
ThreadLocal<WebDriver> driver = new ThreadLocal<WebDriver>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment