There are various reasons and essential for this special functionality for everyday selenium-users.
if(isElementPresent(By.cssSelector(Value)))
System.out.println("...");
else
System.out.println("...");
#2
Checks the availability using size()
if(driver.findElements(By.id("Value)).size()>0)
{
System.out.println("...");
} else
{
System.out.println("...");
}
isElementPresent() // positive test case
#1if(isElementPresent(By.cssSelector(Value)))
System.out.println("...");
else
System.out.println("...");
#2
Checks the availability using size()
if(driver.findElements(By.id("Value)).size()>0)
{
System.out.println("...");
}else
{
System.out.println("...");
}
System.out.println("...");
}else
{
System.out.println("...");
}
!isElementPresent() // negative test case
if(!isElementPresent(By.xpath("Value"))){
System.out.println("...");
} else
{
System.out.println("...");
}
isDisplayed() - Alternate for isElementPresent()
isDisplayed() is used for verifying whether an element is available on the page or not.
driver.findElement(By.xpath(Value)).isDisplayed();
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeleteBig Data Hadoop training in electronic city
Python Training in electronic city
DataScience with Python Training in electronic city
AWS Training in electronic city
Big Data Hadoop Training in electronic city
Devops Training in electronic city
blockchain Training in electronic city
Hibernate Training in electronic city
Data science Training in Electronic City
Selenium with python Training in Electronic City
It’s really Nice and Meaningful. It’s really cool Blog. You have really helped lots of people who visit Blog and provide them Useful Information. Thanks for Sharing.DataScience with Python Training in Bangalore
ReplyDeletevisit here this my explanation their website dig this browse around this web-site
ReplyDelete