Sometimes, the whole test script is wrapped within a try/catch statement as follows:
@Test
public void searchTest() throws InterruptedException, IOException {
try {
driver.get(HOME_PAGE_URL);
String homePageUrl = driver.getCurrentUrl();
Assert.assertEquals(homePageUrl, HOME_PAGE_URL);
WebElement searchBox = driver.findEleme…
Keep reading with a 7-day free trial
Subscribe to Selenium For Beginners to keep reading this post and get 7 days of free access to the full post archives.