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 4, 2019 in Selenium by Jagdeep
4,370 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,150 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 4, 2020 in Selenium by Sri
• 3,190 points
27,475 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
26,075 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,500 points
13,675 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,190 points
9,143 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,910 points
7,221 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 3, 2020 in Selenium by Sri
• 3,190 points
7,875 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,190 points
8,485 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP