我想创建一个在整个测试套件中使用的通用方法。此方法应将 web 元素作为参数。然后该方法应该返回true
或false
基于它在配置的超时期间的可见性。
public bool WaitForElementVisibility(IWebDriver driver, IWebElement element)
{
try
{
//code to wait until element is displayed similar to this. But instead of passing By.Id(login) pass the element
new WebDriverWait(driver,TimeSpan.FromSeconds(timeOut)).Until(ExpectedConditions.ElementExists((By.Id(login))));
return true;
}
catch(Exception e)
{
return false;
}
}
我正在用硒创建一个框架,C#。您可以在此https://umangamadawala.blogspot.com/中查看我的进度。
提前致谢。