接前面的常用API(一),本文接着介绍如下:

1.press_keycode

press_keycode(self, keycode, metastate=None):

 Sends a keycode to the device. Android only. Possible keycodes can be found in http://developer.android.com/reference/android/view/KeyEvent.html

发送按键码(安卓仅有),模拟点击相应铵键,按键码可以上网址中找到

:Args:

- keycode - the keycode to be sent to the device

- metastate - meta information about the keycode being sent

  Usage:

 driver.press_ keycode(‘4’)      #按返回键

2.long_press_keycode

long_press_keycode(self, keycode, metastate=None):

 Sends a long press of keycode to the device. Android only.

发送一个长按的按键码(长按某键)

:Args:

- keycode - the keycode to be sent to the device

- metastate - meta information about the keycode being sent

  Usage:

  driver.long_press_keycode(‘4’)    #长按返回键

3.is_app_installed

is_app_installed(self, bundle_id):

 Checks whether the application specified by `bundle_id` is installed on the device.

检查app是否有安装

 返回 True or False

:Args:

- bundle_id - the id of the application to query

  Usage:

 driver.is_app_installed(“com.xxxx”)     #app包名

4.install_app

install_app(self, app_path):

 Install the application found at `app_path` on the device.

安装app,app_path为安装包路径

:Args:

- app_path - the local or remote path to the application to install

  Usage:

 driver.install_app(app_path)

5.remove_app

remove_app(self, app_id):

 Remove the specified application from the device.

删除app

:Args:

- app_id - the application id to be removed

 Usage:

driver.remove_app(“com.xxx.”)   #app包名

6.open_notifications

open_notifications(self):

 Open notification shade in Android (API Level 18 and above)

 打系统通知栏(仅支持API 18 以上的安卓系统)

 Usage:

 driver.open_notifications()    ##打开系统通知栏

7.launch_app

launch_app(self):

 Start on the device the application specified in the desired capabilities.

 启动app

 Usage:

 driver.launch_app()     #启动应用,一般与close_app配合使用

8.close_app

close_app(self):

 Stop the running application, specified in the desired capabilities, on the device.

 关闭app

 Usage:

 driver.close_app()    #关闭应用,此方法并非真正的关闭应用,相当于按home键将应用置于后台,可以通过launch_app()再次启动

9.is_selected

is_selected(self):

 Returns whether the element is selected.

Can be used to check if a checkbox or radio button is selected.

 可以用来检查一个复选框或单选按钮被选中,返回元素是否选择 True of False

 Usage:

 element.is_slected()

10.is_enabled

is_enabled(self):

 Returns whether the element is enabled.

返回元素是否可用True of False

 Usage:

 element.is_enabled()

11.is_displayed

is_displayed(self):

 Whether the element is visible to a user.

 判断此元素用户是否可见。返回True of False

 Usage:

 driver.element.is_displayed()   #判断是否显示

12.close

close(self):

Closes the current window.

关闭当前窗口

Usage:

driver.close()

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

  1. 7、Appium常用API

    嗯,官网已经介绍的很全了.会选几个常用API后期整理. Appium常用API地址:http://appium.io/docs/cn/writing-running-appium/appium-bin ...

  2. appium 常用api介绍(2)

    前言:接着上一篇继续讲常用的一些api 参考博文:http://blog.csdn.net/bear_w/article/details/50330565 1.send_keys send_keys( ...

  3. appium 常用API使用总结!

    将常用函数进行适用总结,后期在使用的过程中直接查找调用即可 获取界面属性.控件属性 1.current_activity:获取activity名称 device.current_activity 2. ...

  4. Appium常用API(一)

    Appium作为当下一款移动应用的自动化测试工具,对于测试来说重要性不言可寓,废话不多说,下面总结下它常用的API: 1.contextscontexts(self): Returns the con ...

  5. appium 常用API

    ''.appium api第二弹 锋利的python,这是初稿,2015/1/5 如有错误的地方,请同学们进行留言,我会及时予以修改,尽量整合一份ok的api 作者:Mads Spiral QQ:79 ...

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

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

  7. appium 常用api介绍(1)

    前言:android手机大家都很熟悉,操作有按键.触摸.点击.滑动等,各种操作方法可以通过api的方法来实现. 参考博文:http://blog.csdn.net/bear_w/article/det ...

  8. Appium常用Api实操

    本文是基于python语言在android上实操的,仅记录(忽略排版~~~) 会不时更新的: from appium import webdriver from selenium.webdriver. ...

  9. APPIUM 常用API介绍(3)

    1.send_keys send_keys(self, *value): Simulates typing into the element[在元素中模拟输入(开启appium自带的输入法并配置了ap ...

随机推荐

  1. Tomcat 性能优化(连接数、线程、JVM、dir)

    Tomcat的server.xml中Context元素的以下参数应该怎么配合适 <Connector port="8080" maxThreads="150&quo ...

  2. Mysql向存储过程中传递中文参数变成乱码的解决方案

    今天做程序需要用到一个存储过程,然后用php程序调用.  存储过程如下: delimiter $$ CREATE PROCEDURE disagree_upgrade_detail(a int,b t ...

  3. codeforce1029B B. Creating the Contest(简单dp,简单版单调栈)

    B. Creating the Contest time limit per test 1 second memory limit per test 256 megabytes input stand ...

  4. hihocoder-1080题解

    一.题目链接 http://hihocoder.com/problemset/problem/1080 二.题意 一维区间,需要做区间增加和区间置值,以及对整个区间求和. 三.思路 显然线段树是个利器 ...

  5. Java前期(静态)绑定和后期(动态)绑定

    Java前期(静态)绑定和后期(动态)绑定 程序绑定的概念:绑定指的是一个方法的调用与方法所在的类(方法主体)关联起来.对java来说,绑定分为静态绑定和动态绑定:或者叫做前期绑定和后期绑定. 静态绑 ...

  6. ExtJS动态创建组件

    J是代码动态创建dom: 或者 eval有后台组织代码,前台执 ======================= ExtJS组件的动态的创建: 程序中大多数时候需要在后台根据业务逻辑创建符合要求的组件, ...

  7. 《Linux内核精髓:精通Linux内核必会的75个绝技》一HACK #9 RT Group Scheduling 与RT Throttling

    HACK #9 RT Group Scheduling 与RT Throttling 本节介绍对实时进程所使用的CPU时间进行限制的功能RT Group Scheduling和RT Throttlin ...

  8. 一线工程师带你深入学习和使用Kubernetes

    http://page.factj.com/tor/xoxaHR0cDovL2RvY2tvbmUuaW8vYXJ0aWNsZS8yMzM0 Kubernetes是Google开源的容器集群管理系统,它 ...

  9. Python开发一个堡垒机

    项目实战:运维堡垒机开发 前景介绍 到目前为止,很多公司对堡垒机依然不太感冒,其实是没有充分认识到堡垒机在IT管理中的重要作用的,很多人觉得,堡垒机就是跳板机,其实这个认识是不全面的,跳板功能只是堡垒 ...

  10. 配置mysql环境变量

    配置mysql环境变量(非必要) 说明:给mysql配置环境变量后我们就可以在cmd里运行mysql(开启.停止等操作) 1. 和其实环境变量的配置方法一样,我们打开环境变量配置窗口(组合键win+P ...