龙空技术网

Appium自动化测试入门教程No.5——Python-Client安装并测试

川石信息 143

前言:

而今看官们对“pythonhttpclient”大约比较讲究,姐妹们都需要分析一些“pythonhttpclient”的相关文章。那么小编也在网上搜集了一些关于“pythonhttpclient””的相关知识,希望朋友们能喜欢,大家快快来学习一下吧!

一、前提准备条件:

1、安装 Python 语言 , Python的安装相对简单;

2、Python 编辑器有很多,推荐:PyCharm、Atom、Sublime text3等;

二、安装 python-client:

推荐pip安装:

(venv) λ pip install Appium-Python-Client

Collecting Appium-Python-Client

Using cached Appium-Python-Client-0.24.tar.gz

Requirement already satisfied: selenium>=2.47.0 in d:\pyflask\venv\lib\site-packages (from Appium-Python-Client)

Building wheels for collected packages: Appium-Python-Client

Running setup.py bdist_wheel for Appium-Python-Client ... done

Stored in directory: C:\Users\fnngj\AppData\Local\pip\Cache\wheels\2e\cf\10\0e3f177c9869147b16584d402f79d9007df1139105ea3ecc2c

Successfully built Appium-Python-Client

Installing collected packages: Appium-Python-Client

Successfully installed Appium-Python-Client-0.24

三、运行第一个Appium测试:

第一步,启动Android模拟器

第二步,启动 Appium Server

点击右上角 三角 按钮,注意Appium的启动日志。

> Launching Appium server with command: D:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --log-no-color

> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)

> info: Appium REST http interface listener started on 127.0.0.1:4723

> info: [debug] Non-default server args:

{"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}

> info: Console LogLevel: debug

Appium在启动时默认占用本机的4723端口,即:127.0.0.1:4723

第三步,编写 appnium 测试脚本

运行上面的脚本,你将会看到 Android 模拟器如下运行界面:

标签: #pythonhttpclient