C and Selenium Wait Until Element is Present

0 votes

I want to wait untill an element is visible before WebDriver performs actions. I learnt that was possible with something like this:

WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0,0,5));
wait.Until(By.Id("login"));

But this has some kind of flaw. Can someone help me out?

Apr 20, 2018 in Selenium by kappa3010
• 2,090 points
10,216 views

2 answers to this question.

0 votes

Your logic is just slightly off..The actual syntax is below. 
PS: This is by using Implicit wait for a pre-defined period of time before untill when WebDriver will wait to resume execution.

driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
answered Apr 20, 2018 by king_kenny
• 3,710 points
0 votes
WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0,0,5));
wait.Until(expectedconditions.elementtobeclickable("element"));
answered Sep 3, 2020 by Sri
• 3,010 points

Related Questions In Selenium

0 votes
5 answers
0 votes
1 answer

What is IWebElement and how it is used in Selenium C#?

Hello Paul, IWebElement is an Interface in ...READ MORE

answered Jun 10, 2019 in Selenium by Esha
5,009 views
0 votes
1 answer
+1 vote
4 answers

Need to wait until page is completely loaded - Selenium WebDriver

You can try something like -  new WebDriverWait(firefoxDriver, ...READ MORE

answered Dec 20, 2019 in Selenium by Robin
39,946 views
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
5,092 views
0 votes
1 answer

Impilicit wait vs Explicit wait vs Fluent wait

Implicit wait: Your telling the WebDriver the ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,710 points
2,139 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,826 views
0 votes
2 answers

Need Selenium to wait until the document is ready.

use  (JavascriptExecutor) driver).executeScript("return docum ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,010 points
7,140 views
+1 vote
2 answers