Selecting the current browser using webdriver
private void selectBrowser(String browserTitle) {
Set<String> windows = driver.getWindowHandles();
for (String win : windows) {
if (
driver.switchTo().window( win).getTitle().contains( browserTitle)) {
driver.switchTo().window( win);
driver.switchTo(). defaultContent();
break;
}
}
Set<String> windows = driver.getWindowHandles();
for (String win : windows) {
if (
driver.switchTo().window(
driver.switchTo().window(
driver.switchTo().
break;
}
}
Selenium training in Chennai
ReplyDeleteWe provide best selenium training in Chennai with real time scenarios.For real time training reach us 8122241286 and become experts in selenium.
selenium training in chennai