RobotFrameWork+APPIUM实现对安卓APK的自动化测试----第六篇【AppiumLibrary等待函数介绍】

来源:互联网 发布:淘宝专业差评怎么找 编辑:程序博客网 时间:2024/05/16 05:19

废话不多说,少年们请看下面。

Wait Until Page Containstext, timeout=None, error=None

Waits until text appears on current page.

Fails if timeout expires before the text appears. Seeintroduction for more information about timeout and its default value.

error can be used to override the default error message.

See also Wait Until Page Does Not Contain, Wait Until Page Contains Element, Wait Until Page Does Not Contain Element and BuiltIn keyword Wait Until Keyword Succeeds.

Wait Until Page Contains Elementlocator, timeout=None, error=None

Waits until element specified with locator appears on current page.

Fails if timeout expires before the element appears. Seeintroduction for more information about timeout and its default value.

error can be used to override the default error message.

See also Wait Until Page Contains, Wait Until Page Does Not Contain Wait Until Page Does Not Contain Element and BuiltIn keyword Wait Until Keyword Succeeds.

Wait Until Page Does Not Containtext, timeout=None, error=None

Waits until text disappears from current page.

Fails if timeout expires before the text disappears. See introduction for more information about timeout and its default value.

error can be used to override the default error message.

See also Wait Until Page Contains, Wait Until Page Contains Element, Wait Until Page Does Not Contain Element and BuiltIn keyword Wait Until Keyword Succeeds.

Wait Until Page Does Not Contain Elementlocator, timeout=None, error=None

Waits until element specified with locator disappears from current page.

Fails if timeout expires before the element disappears. Seeintroduction for more information about timeout and its default value.

error can be used to override the default error message.

See also Wait Until Page Contains, Wait Until Page Does Not Contain, Wait Until Page Contains Element and BuiltIn keyword Wait Until Keyword Succeeds.

咳咳咳~我来给大家翻译翻译~搬个砖,

1.Wait Until Page Contains 等待直到界面包含什么文字信息才进行下一步,参数【text】需要检索的文本信息,【timeout=None】超时属性,也就是等待多少时间还不出现就结束该语句,【error=None】是否报错,作者是个懒人这个属性一直默认,有兴趣的同志们可以自己试试。

2.Wait Until Page Contains Element 等待直到界面包含什么元素才进行下一步,这里先说下元素等位都是locator的事情,如果对这个不太清楚的同志们坐等下一篇。

3.Wait Until Page Does Not Contain 等待直到界面不包含什么文字信息才进行下一步

4.Wait Until Page Does Not Contain Element 等待直到界面不包含什么元素才进行下一步

好啦这一篇内容不多,最后给大家一个万恶的函数,为啥这么说呢,因为简单粗暴无需动脑,就是【sleep】函数是BuiltIn的自带函数用法超级简单sleep | 10s,就OK了,下一篇作者打算和同志聊聊locator,坐标点击,和一些在项目中遇到的大中小各种坑 。

最后忍不住剑剑需要坐火车回家的同胞们,候车室里多保暖噢~O(∩_∩)O哈哈~,在这里祝大家过个好年。

0 0