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,020 points
5,807 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,650 points

Related Questions In Selenium

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
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,110 points
916 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,650 points
949 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,650 points
2,511 views
0 votes
2 answers