简体   繁体   中英

How to wait until element is shown? selenium webdriver C#

I need to do some actions when an element is shown but I don't know how to wait for it, on selenium document they use Until(ExpectedConditions.ElementIsVisible(By.xPath(""))); , but when I try to do it ExpectedConditions doesn't exists so, how can I wait for an element?

ExpectedConditions is under SeleniumExtras.WaitHelpers

using SeleniumExtras.WaitHelpers;

var wait = new WebDriverWait(driver, new TimeSpan(0, 0, 30));
var element = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.XPath("")));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM