版权声明:如需转载本文章,请保留出处! https://blog.csdn.net/xc_zhou/article/details/89609177
https://github.com/appium/sample-code/tree/master/sample-code/examples/python 其中要求安装:
pip install Appium-Python-Client
pip install pytest
启动验证: 启动之后,在浏览器中输入http://localhost:4723/wd/hub/status出现下面代码说明成功
{“status”:0,“value”:{“build”:{“version”:“1.12.1”}},“sessionId”:null}
下载地址:https://github.com/appium/sample-code/tree/master/sample-code 添加联系人的示例代码
修改后,如下
我遇到的问题:在终端运行时提示:在文件夹中找不到对应的apk文件 直接运行E:\appium1\PythonSamples>android_contacts.py
原因:下面代码绝对路径错误
desired_caps['app'] = PATH(
'../../../sample-code/apps/ContactManager/ContactManager.apk'
)
这段代码的地址错误。根据提示将对应的apk文件放到对应的路径就可以了 例如:
desired_caps['app'] = PATH(
'E:/appium1/apps/ContactManager/ContactManager.apk'
)
运行android_contacts.py文件,成功运行
模拟器端的运行情况
由于Appium Desktop出来了,所以使用appium要比以前简单许多
1、启动Appium Desktop
2、启动成功后如图,点击inspector
3、查看设备是否链接成功
4、在inspector中添加参数,点击【start Session】
5、成功启动后如图
参考:https://testerhome.com/topics/8038 https://testerhome.com/topics/11534