【发布时间】:2016-10-11 10:26:04
【问题描述】:
我在 C# 上使用 selenium webdriver,并且我正在使用页面对象模块。现在我需要一个用于显式等待的语法,因为我已经拥有了 web 元素。
[FindsBy(How = How.Id, Using = "Passwd")]
public IWebElement Password {get;set;}
[FindsBy(How = How.Id, Using = "signIn")]
public IWebElement Signin { get; set; }
我需要等到找到元素密码。
在使用这个模块之前,我正在使用:
WebDriverWait wait = new WebDriverWait(driver.driver, TimeSpan.FromSeconds(Time));
wait.Until(ExpectedConditions.ElementExists(by));
现在我需要使用手中的元素。
【问题讨论】: