续接上一文,更多API详细如下:

注:更多官方详情信息见 http://robotframework.org/robotframework/

28. Name: Install App

Source: AppiumLibrary <test library>

Arguments: [ app_path | app_package ]

Install App via Appium.

通过Appium安装App。

Android only.

app_path - path to app

app_package - package of install app to verify

29. Name: Launch Application

Source: AppiumLibrary <test library>

Arguments: [ ]

Launch application. Application can be launched while Appium session running. This keyword can be used to launch application during test case or between test cases.

启动程序。 应用程序可以在Appium会话运行时启动。 此关键字可用于在测试用例期间或测试用例之间启动应用程序。

This keyword works while `Open Application` has a test running. This is good practice to `Launch Application` and `Quit Application` between test cases. As Suite Setup is `Open Application`, `Test Setup` can be used to `Launch Application`

30. Name: Log Source

Source: AppiumLibrary <test library>

Arguments: [ loglevel=INFO ]

Logs and returns the entire html source of the current page or frame.

记录并返回当前页面或框架的整个html源。

The `loglevel` argument defines the used log level. Valid log levels are `WARN`, `INFO` (default), `DEBUG`, `TRACE` and `NONE` (no logging).

31. Name: Long Press

Source: AppiumLibrary <test library>

Arguments: [ locator ]

Long press the element.

长按某元素。

32. Name: Long Press Keycode

Source: AppiumLibrary <test library>

Arguments: [ keycode | metastate=None ]

Sends a long press of keycode to the device.

向设备发送长按键代码。

Android only.

See `press keycode` for more details.

33. Name: Open Application

Source: AppiumLibrary <test library>

Arguments: [ remote_url | alias=None | **kwargs ]

Opens a new application to given Appium server.

打开一个新应用通过Appium服务器。

Capabilitiesofappiumserver,AndroidandiOS,Pleasecheckhttp://appium.io/slate/en/master/?python#appium-server-capabilities

34. Name: Press Keycode

Source: AppiumLibrary <test library>

Arguments: [ keycode | metastate=None ]

Sends a press of keycode to the device.

向设备发送按键代码。

Android only.

Possible keycodes& meta states can be found in http://developer.android.com/reference/android/view/KeyEvent.html

35. Name:Quit Application

Source: AppiumLibrary <test library>

Arguments:[ ]

Quit application. Application can be quit while Appium session is kept alive. This keyword can be used to close application during test case or between test cases.

退出应用。 在Appium会话保持活动状态时,应用程序可以退出。 此关键字可用于在测试用例期间或测试用例之间关闭应用程序。

See `Launch Application` for an explanation.

New in AppiumLibrary 1.4.6

36. Name: Remove Application

Source: AppiumLibrary <test library>

Arguments: [ application_id ]

Removes the application that is identified with an application id .

删除应用程序。

Example:

Remove Application  com.netease.qa.orangedemo

37. Name: Reset Application

Source: AppiumLibrary <test library>

Arguments: [ ]

Reset application. Open Application can be reset while Appium session is kept alive.

重置应用。 Appium会话保持活动状态时,可以重置打开应用程序。

38. Name: Scroll

Source: AppiumLibrary <test library>

Arguments: [ start_locator | end_locator ]

Scrolls from one element to another Key attributes for arbitrary elements are `id` and `name`. See `introduction` for details about locating elements.

39. Name: Scroll Down

Source: AppiumLibrary <test library>

Arguments: [ locator ]

Scrolls down to element.

向下滚动到元素。

40. Name: Scroll Up

Source: AppiumLibrary <test library>

Arguments: [ locator ]

Scrolls up to element.

向上滚动到元素。

41. Name: Shake

Source: AppiumLibrary <test library>

Arguments: [ ]

Shake the device.

摇晃设备。

42. Name: Start Activity

Source: AppiumLibrary <test library>

Arguments: [ appPackage | appActivity | **opts ]

Opens an arbitrary activity during a test. If the activity belongs to another application, that application is started and the activity is opened.

在测试期间打开一个活动。 如果活动属于另一个应用程序,则启动该应用程序并打开活动。

Android only.

appPackage - The package containing the activity to start.

appActivity - The activity to start.

appWaitPackage - Begin automation after this package starts (optional).

appWaitActivity - Begin automation after this activity starts (optional).

intentAction - Intent to start (opt_ional).

intentCategory - Intent category to start (optional).

intentFlags - Flags to send to the intent (optional).

optionalIntentArguments - Optional arguments to the intent (optional).

stopAppOnReset - Should the app be stopped on reset (optional)?

43. Name: Swipe

Source: AppiumLibrary <test library>

Arguments:[ start_x | start_y | offset_x | offset_y | duration=1000 ]

Swipe from one point to another point, for an optional duration.

连续从一个点滑动到另一个点。

Args:

start_x - x-coordinate at which to start

start_y - y-coordinate at which to start

offset_x - x-coordinate distance from start_x at which to stop

offset_y - y-coordinate distance from start_y at which to stop

duration - (optional) time to take the swipe, in ms.

Usage:

Swipe  500  100  100  0  1000

NOTE: Android 'Swipe' is not working properly, use offset_x and offset_y as if these are destination points.

44. Name: Switch To Context

Source: AppiumLibrary <test library>

Arguments: [ context_name ]

Switch to a new context.

切换到新的上下文。

45. Name: Tap

Source: AppiumLibrary <test library>

Arguments: [ locator | x_offset=None | y_offset=None | count=1 ]

Tap element identified by locator.

点击已定位标识的元素。

Args:

x_offset - (optional) x coordinate to tap, relative to the top left corner of the element.

y_offset - (optional) y coordinate. If y is used, x must also be set, and vice versa

count - can be used for multiple times of tap on that element

46. Name: Zoom

Source: AppiumLibrary <test library>

Arguments: [ locator | percent=200% | steps=1 ]

Zooms in on an element a certain amount.

放大元素到一定数量。

47. Name: Wait Activity

Source: AppiumLibrary <test library>

Arguments: [ activity | timeout | interval=1 ]

Wait for an activity: block until target activity presents or time out.

等待一个活动:阻止直到目标活动出现或超时。

Android only.

activity - target activity

timeout - max wait time, in seconds

interval - sleep interval between retries, in seconds

上面都是实践过程会经常用的API,需熟练掌握~

Robotframework-Appium 之常用API(二)的更多相关文章

  1. Appium之常用API

    Appium常用API解析 1.current_activity:获取当前页面的activity名,比如com.taobao.tao.TBMainActivity 或 com.taobao.brows ...

  2. appium自动化常用API

    常用函数 一.获得信息类API (1)获取当前页面的activity名,比如: (.ui.login.ViewPage)  current_activity() 比如我们需要实现这个登录的功能时,主要 ...

  3. Robotframework + Appium 之常用元素定位方法

    任何自动化测试,其实手动测试也是一样的,元素定位(目标定位)是首要任务,这是最直接的测试对象呀! 好了,废话不多说,又到了元素定位啦,之前我们已经介绍过selenium及appium常用的定位方法,下 ...

  4. Express4.x常用API(二):Request

    这是第二篇了,打算每天都拿些时间去详细的看看文档来自学下express吧,接下来就开始了,这次依然是有选择性的找API根据自己的理解翻译过来,方便日后开发时候的自己查阅,由于水平有限,大概也会在使用过 ...

  5. Java学习随笔---常用API(二)

    Object类的toString方法 将一个对象返回为字符串形式,但一般使用的时候会覆盖重写toString方法 Object类是所有类的父亲 // public class Person { pri ...

  6. Appium driver常用API

    click driver.find_element implicitly_wait send_keys close quit get_window_size switch_to execute bac ...

  7. Java(23)常用API二

    作者:季沐测试笔记 原文地址:https://www.cnblogs.com/testero/p/15228415.html 博客主页:https://www.cnblogs.com/testero ...

  8. Appium常用API(二)

    接前面的常用API(一),本文接着介绍如下: 1.press_keycode press_keycode(self, keycode, metastate=None): Sends a keycode ...

  9. 【OpenGL游戏开发之二】OpenGL常用API

    OpenGL常用API 开发基于OpenGL的应用程序,必须先了解OpenGL的库函数.它采用C语言风格,提供大量的函数来进行图形的处理和显示.OpenGL库函数的命名方式非常有规律.所有OpenGL ...

  10. Servlet 常用API学习(二)

    Servlet常用API学习 一.HTTP简介 WEB浏览器与WEB服务器之间的一问一答的交互过程必须遵循一定的规则,这个规则就是HTTP协议. HTTP是 hypertext transfer pr ...

随机推荐

  1. Redis need tcl 8.5 or newer

    hadoop@stormspark:~/workspace/redis2.6.13/src$ make testYou need tcl 8.5 or newer in order to run th ...

  2. Java 枚举那点事

    目录 最近有需求,想存自定义的枚举值,比如 HOTLINE("Hotline") 我想存 Hotline 于是研究了一下Java的枚举问题 如下数据库的Entity (贫血模型哈) ...

  3. 利用 setInterval 确定用户的动作是否停止

    最近遇到一个问题,对于某一个持续的动作,希望能够知晓用户何时停止这个动作, 比如说 我们通过注册onresize事件,去监听浏览器窗口变化的事件,在这个事件里面,我们可能要执行大量的计算去确定窗口变化 ...

  4. HttpSession的关键属性和方法

    1.当一个用户向服务器发送第一个请求时,服务器为其建立一个session,并为此session创建一个标识号:2.这个用户随后的所有请求都应包括这个标识号.服务器会校对这个标识号以判断请求属于哪个se ...

  5. Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) on project : <properties> resource does not exist

    使用mybatis-generator自动生成mapper.dao等文件时,报错如下: org.apache.maven.lifecycle.LifecycleExecutionException: ...

  6. luoguP3367 [模板]并查集

    题目链接:https://www.luogu.org/problemnew/show/P3367 思路: 今天学了新算法——并查集,本题是简单的并查集题的模板. 核心思想是“递归+压缩路径”. 并查集 ...

  7. Tree(树链剖分+线段树延迟标记)

    Tree http://poj.org/problem?id=3237 Time Limit: 5000MS   Memory Limit: 131072K Total Submissions: 12 ...

  8. TIME_WAIT状态的作用

    TIME_WAIT状态: 主动关闭的那端最后经历的状态,一般为2MSL秒(1~4分钟). 两个原因: 保证当最后一个ack丢失后,能收到对端重传的fin包. 保证ack包消失,不会影响下一个连接. 关 ...

  9. 10-多写一个@Autowired导致程序崩了

    再是javaweb实验六中,是让我们改代码,让它跑起来,结果我少注释了一个,导致一直报错,检查许久没有找到,最后通过代码替换逐步查找,才发现问题.

  10. Ui设计流行趋势,对颜色的探讨

    设计风向转换的趋势越来越短,在设计圈中,流行设计的跟新换代更是快.在设计时间越来越短的今天,在经理领导不断催促的时下,如何准确的把握当下的流行趋势,如何在设计之初就能定好设计的基调.这对于还是刚入设计 ...