How to Handle Multiple Windows In Selenium WebDriver?
With WindowHandle.
String currentWindowHandle = driver.getWindowHandle();
findElement(By.linkText("aaa)).click();
String newWindowTabHandle = driver.getWindowHandles().stream()
.filter(h -> !h.equals(currentWindowHandle)).findFirst().get();
driver.switchTo().window(newWindowTabHandle);Types of assertion in testNG
Soft Asserts, Hard Asserts and Verify.
Soft Asserts are not included by default and need a separate package. They will not stop the test from continuing execution.
Hard Asserts throw Exception and move to the next @Test.