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,010 points
2,576 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,590 points

Related Questions In Selenium

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How different/ similar are Protractor and Selenium? Which is better?

Okay, so let me talk about the ...READ MORE

answered Apr 2, 2018 in Selenium by nsv999
• 5,030 points
836 views
0 votes
1 answer

What is the difference between thoughtworks.selenium and openqa.selenium selenium?

thoughtworks.selenium is the original Selenium (aka Selenium 1, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,590 points
86 views
0 votes
1 answer

Need to wait until page is completely loaded - Selenium WebDriver

Using Thread.Sleep(); is one approach; but its ...READ MORE

answered Apr 2, 2018 in Selenium by nsv999
• 5,030 points
2,410 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,030 points
71 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,590 points
540 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,590 points
1,129 views
0 votes
2 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.