宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

注:从原文档一个个扒出来翻译的,有不对的地方还请批评指正。
1、 titleIs String title)

判断当前页面的title是否精确等于预期

2、 titleContains String title)

判断当前页面的title是否包含预期字符串

3、 urlToBe String url)

判断当前页面的url是否精确等于预期

4、 urlContains String fraction)

判断当前页面的url是否包含预期字符串

5、 urlMatches String regex)

字符串正则表达式

6、 presenceOfElementLocated By locator)

判断元素是否出现,只要有一个元素出现,就通过。(代表在不代表可见)
判断是否至少有 1 个元素存在于 dom 树中。举个例子,如果页面上有 n 个元素的 class 都是’column-md-3’,那么只要有 1 个元素存在,这个方法就返回 True。

7、 presenceOfElementsLocated By locator)

判断元素是否出现,必须所有符合条件的元素都加载出来,才通过。

8、 elementIfVisibleWebElement element)

如果给定元素是可见的且具有非零大小,否则为null

9、presenceOfAllElementsLocatedBy By locator)

判断元素是否出现。

10、 visibilityOfElementLocated By locator)

传入类型为:locator
判断某个元素是否可见. 可见代表元素非隐藏,并且元素宽和高都不等于 0

11、visibilityOfAllElementsLocatedBy By locator)

判断某组元素是否可见

12、visibilityOfAllElementsfinal List<WebElement> elements)

传入类型为:element
判断某个元素是否可见. 可见代表元素非隐藏,并且元素宽和高都不等于 0

13、textToBePresentInElement WebElement element,  String text)

判断某个元素中的text是否包含了预期的字符串;

14、textToBePresentInElementBy locator, String text)

判断某个元素中的 text 是否 包含 了预期的字符串

15、textToBePresentInElementLocatedfinal By locator, final String text)

判断某个元素中的 text 是否 包含 了预期的字符串

16、textToBePresentInElementValue WebElement element, String text)

判断某个元素中的 value 属性是否包含 了预期的字符串

17、textToBePresentInElementValuefinal By locator, final String text)

判断某个元素中的 value 属性是否包含 了预期的字符串

18、frameToBeAvailableAndSwitchToItfinal String frameLocator)

断该 frame 是否可以 switch进去,如果可以的话,返回 True 并且 switch 进去,否则返回 False

19、frameToBeAvailableAndSwitchToItfinal By locator)

断该 frame 是否可以 switch进去,如果可以的话,返回 True 并且 switch 进去,否则返回 False

20、invisibilityOfElementLocatedfinal By locator)

某个元素中是否不存在于dom树或不可见;

21、invisibilityOfElementWithTextfinal By locator, final String text)

判断带有文本的元素要么不可见,要么文本不存在于元素上

22、elementToBeClickablefinal By locator)

判断某个元素中是否可见并且是enable的,这样的话才叫clickable;

23、elementToBeClickablefinal WebElement element)

判断某个元素中是否可见并且是enable的,这样的话才叫clickable;

24、stalenessOffinal WebElement element)

判断一个元素是否仍在DOM中,传入WebElement对象,可以判断页面是 否刷新了。

25、refreshedfinal ExpectedCondition<T> condition)

26、elementToBeSelectedWebElement element)
页面元素处于被选中状态

27、elementSelectionStateToBe WebElement element,  boolean selected)

判断某个元素的选中状态是否符合预期,传入element

28、elementToBeSelectedBy locator)

判断某个元素是否被选中了,一般用在下拉列表;

29、elementSelectionStateToBefinal By locator, final boolean selected)

判断某个元素的选中状态是否符合预期,传入locator

30、alertIsPresent)

判断页面上是否存在alert。

31、notfinal ExpectedCondition<?> condition)

32、WebElement findElementBy by, WebDriver driver)

33、List<WebElement> findElementsBy by, WebDriver driver)

34、isElementPresentBy.id"xxx")

234567

        </div>
					<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-258a4616f7.css" rel="stylesheet">
                  </div>