我试图使用“attributeContains”方法,但在使用 C# 时没有可用的方法。https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#attributeContains-org.openqa.selenium.WebElement-java.lang.String-java。 lang.String-
有什么解决办法吗?
您随时可以创建您的自定义预期条件:
public void AttributeContains(By locator, String attribute, String value, int secondsToWait = 30)
{
new WebDriverWait(driver, new TimeSpan(0, 0, secondsToWait))
.Until(d => d.FindElement(locator).GetAttribute(attribute) == value);
}
Forgive my rusty C# skills in case there are syntax errors.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)