Is it possible to use webdriverwait for checking the visiblity of an element in webdriver?

0 votes
Is it possible to use webdriverwait for checking the visiblity of an element in webdriver?
Jul 3 in Selenium by Jagdeep
33 views

1 answer to this question.

0 votes

Hello Jagdeep, Yes it is possible to use WebDriverWait to check the visibility of an element in Selenium Webdriver. You can use ExpectedConditions methods to check whether an element is visible or invisible. Following code snippet shows how to check visibility or invisibility of a web element:

System.setProperty("webdriver.chrome.driver", "D:\\chromeDriver.exe");

WebDriver driver = new ChromeDriver();

driver.get("https://www.facebook.com");

WebElement element = driver.findElement(By.id("id"));

WebDriverWait wait = new WebDriverWait(driver,30);

// Wait and check element visibility

wait.until(ExpectedConditions.visibilityOfElementLocated(element));

// Wait and check element invisibility

wait.until(ExpectedConditions.invisibilityOf(element));
answered Jul 4 by Anvi
• 12,860 points

Related Questions In Selenium

0 votes
2 answers
0 votes
1 answer

Is it possible to manually set the attribute value of a Web Element using Selenium?

Yes, its very much possible. You just ...READ MORE

answered May 8, 2018 in Selenium by king_kenny
• 3,650 points
5,671 views
+1 vote
2 answers
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
589 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
898 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
575 views
0 votes
1 answer