This blog is for Automation Test Engineers

Sunday, 3 September 2017

To Check whether image is displayed or not




WebDriver driver=new FirefoxDriver();
driver.get("https://www.google.co.in");
WebElement image= driver.findElement(By.id("hplogo"));
Boolean status=image.isDisplayed();
if(status==true){
System.out.println("Image is displayed");
}
else{
System.out.println("Image is not displayed");
}

Output:true


0

0 comments:

Post a Comment