Aldin_SXR

Selenium setup

Jan 10th, 2022 (edited)
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. private static WebDriver webDriver;
  2. private static String baseUrl;
  3.  
  4. @BeforeAll
  5. static void setUpBeforeClass() throws Exception {
  6.     System.setProperty("webdriver.chrome.driver", "/path/to/chromedriver");
  7.     webDriver = new ChromeDriver();
  8.     baseUrl = "https://your.url/";
  9.        
  10.     webDriver.manage().window().maximize();
  11. }
  12.  
  13. @AfterAll
  14. static void tearDownAfterClass() throws Exception {
  15.     webDriver.close();
  16. }
Add Comment
Please, Sign In to add comment