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
2,629 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,130 points

Related Questions In Selenium

+1 vote
2 answers
+1 vote
2 answers

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

WebDriver driver; JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('id123').setAttribute('attr', ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,010 points
18,055 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
20,947 views
0 votes
2 answers
0 votes
2 answers

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,520 points
4,641 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,480 views
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
3,310 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
3,913 views
0 votes
2 answers

Is there any way to get the text of a web element using Selenium Webdriver?

use gettext() in java : string lableText = ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,010 points
5,369 views
0 votes
1 answer