Selenium显示等待常用的等待条件ExpectedConditions
Posted 桃花雪
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Selenium显示等待常用的等待条件ExpectedConditions相关的知识,希望对你有一定的参考价值。
new WebDriverWait(Drivers._driverInstance, new TimeSpan(0, 0, 2)).Until(ExpectedConditions.InvisibilityOfElementLocated(locator));
ExpectedConditions.InvisibilityOfElementLocated(locator)等待指定元素消失
ExpectedConditions.TextToBePresentInElement 等待指定元素text出现(包含)某文字
ExpectedConditions.ElementIsVisible
ExpectedConditions.ElementExists
ExpectedConditions.titleIs
ExpectedConditions.titleContains
ExpectedConditions.UrlToBe
ExpectedConditions.UrlContains
ExpectedConditions.elementSelectionStateToBe(By.xpath("//*[@id=\'kw\']"), true) //判断某个元素的选中状态是否符合预期
ExpectedConditions.alertIsPresent 出现alert
presenceOfAllElementsLocatedBy 检查网页上是否存在某个元素
· elementSelectionStateToBe()
· elementToBeClickable()
· elementToBeSelected()
· frameToBeAvaliableAndSwitchToIt()
· invisibilityOfTheElementLocated()
· invisibilityOfElementWithText()
· presenceOfAllElementsLocatedBy()
· presenceOfElementLocated()
· textToBePresentInElement()
· textToBePresentInElementLocated()
· textToBePresentInElementValue()
· titleIs()
· titleContains()
· visibilityOf()
· visibilityOfAllElements()
· visibilityOfAllElementsLocatedBy()
· visibilityOfElementLocated()
以上是关于Selenium显示等待常用的等待条件ExpectedConditions的主要内容,如果未能解决你的问题,请参考以下文章