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,080 points
7,835 views

1 answer 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

Related Questions In Selenium

0 votes
2 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
2,014 views
0 votes
1 answer
+1 vote
3 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
10,920 views
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
2,142 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
1,302 views
0 votes
1 answer
0 votes
1 answer

Need Selenium to wait until the document is ready.

Use this: driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS); This piece of code will ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,710 points
3,682 views
+1 vote
2 answers