IF you are a Selenium Web Driver Automation tester than most probably you would have gone through this situation, In which you have faced one exception that speaks “Element not found”.
I Found Solution for this scenario........
Case 1:
boolean elements ;
elements = driver.findElements(By.name("masterPassword")).isEmpty();
if(elements == true)
{
System.out.println("Element is not present");
}
else
{
System.out.println("Element is present");
//Do whatever You want
}
Here i am checking whether the element is present or not. Based on that I am writing if() {}and else{} blocks.
I Found Solution for this scenario........
Case 1:
boolean elements ;
elements = driver.findElements(By.name("masterPassword")).isEmpty();
if(elements == true)
{
System.out.println("Element is not present");
}
else
{
System.out.println("Element is present");
//Do whatever You want
}
Here i am checking whether the element is present or not. Based on that I am writing if() {}and else{} blocks.
how can i close second window among no of windows using webdriver
ReplyDelete