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, 2019 in Selenium by Jagdeep
1,568 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, 2019 by Anvi
• 14,090 points

Related Questions In Selenium

+1 vote
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,710 points
13,822 views
+1 vote
2 answers

Is it possible to scroll down in a webpage using selenium webdriver programmed on python?

I using next code for facebook for ...READ MORE

answered May 16, 2019 in Selenium by mslavikas@gmail.com
16,829 views
0 votes
1 answer
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,510 points
3,095 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,890 points
2,346 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,890 points
2,493 views
0 votes
1 answer
0 votes
1 answer