package Sample;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import
org.openqa.selenium.By;
import
org.openqa.selenium.WebDriver;
import
org.openqa.selenium.WebElement;
public class MultipleWindows extends Login
{
public static void MultiWindows(WebDriver
driver, String Searchfor, String value, String Search)
{
Set<String>
winHandleBefore = driver.getWindowHandles();
Iterator<String>
it = winHandleBefore.iterator();
String
mwin= it.next();
String
Pwin = it.next();
driver.switchTo().window(Pwin);
// Fetching the Member details from
the Search Member Pop Up window.
driver.findElement(By.name(Searchfor)).sendKeys(value);
driver.findElement(By.name(Search)).click();
driver.switchTo().window(mwin);
}
}
No comments:
Post a Comment