Answers for "how to check visible in selenium"

0

how to check visible in selenium

• To check Element Present: 
if(driver.findElements(By.xpath("value")).size() != 0){
System.out.println("Element is Present"); 
}else{
System.out.println("Element is Absent");}
• or
if(driver.findElement(By.xpath("value"))!= null){
System.out.println("Element is Present"); 
}else{
System.out.println("Element is Absent"); }
• To check Visible: 
if(driver.findElement(By.cssSelector("a > font")).isDisplayed()){
System.out.println("Element is Visible"); 
}else{
System.out.println("Element is InVisible"); }
• To check Enable: 
if(driver.findElement(By.cssSelector("a > font")).isEnabled()){
System.out.println("Element is Enable"); 
}else{
System.out.println("Element is Disabled"); }
• To check text present 
if(driver.getPageSource().contains("Text to check")){
System.out.println("Text is present"); 
}else{
System.out.println("Text is absent"); }
Posted by: Guest on June-15-2021
0

to check visible in selenium

if(driver.findElement(By.cssSelector("a > font")).isDisplayed())
{ System.out.println("Element is Visible"); }
else{ System.out.println("Element is InVisible"); }
Posted by: Guest on May-29-2021

Code answers related to "how to check visible in selenium"

Browse Popular Code Answers by Language