Appium + python automation (a) - built environment - the (super Detailed)

 Brief introduction

  Today the college entrance examination is due around the precipitation, particularly bad, you Entrance Test for refueling, the people happy Dragon Boat Festival. Automation recently compiled a thing, previously finishing python interface to automate drawing to a close. About to open a new journey and chapter (Appium & python). So the question is to the Prime Minister set up the environment. Long time no built environment has stepped on a lot of pits, appium environment to build more complicated, a lot of colleagues are estimated to be stuck in the environment. So hereby share with you ~

  appium arguably the hottest app to do an automation framework, its main advantage is to support android and ios, another scripting language also supports java and Python. And now hiring requirements need this skill. There is a coming of age 5G. Various app leveraging clusters. So we have to master this skill. Macro brother is good at Python, so the next tutorial is appium + instances of python.

  Learn appium biggest difficulty is to install and set up the environment, 80% of people die from environment to install and set up, and then a no; 10 percent were environmental toss a very tough battle, and finally died; only the remaining 10% of the character well, you can successfully install in one step.

First, prepare the environment

 1, the macro environment is the brother of the 64-bit version of Windows 10 systems (32 students to think of ways oh)

    2,1.8.0_181 (# 64)

    3、android-sdk_r24.3.4-windows

    4、python:3.7

    5, Appia: 1.4.16.1

 

    6、Node.js:node-v10.16.0-x64

 

    7, epochs-python-client

Two, jdk installation

    1. Download jdk package, small series of 64-bit version 1.8, other advanced version should also be possible. Select the corresponding version of the system according to their own

    2, all the way to fool installation, pay attention to the installation path without spaces, do not have Chinese. jdk and jre do not put a folder

    3, set three environment variables, My Computer> select "Properties" -> "Advanced" -> "Environment Variables" -> "System Variables" -> "New"

(1)JAVA_HOME----D:\software\Java\jdk1.8.0_181” (根据自己安装路径填写)

(2)CLASSPATH--- .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;

(3)PATH-----;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;

在path路径下加上面那两个,这里就不多说了

    4、打开cmd验证是否安装成功,输入java -version,然后输入javac

能显示版本号和下面的帮助信息说明安装成功

三、android-sdk下载安装

    1、下载android-sdk,这个是做android测试和开发的必备环境,如果不会下载的话,可以找我要,后期建个群或将其上传上去

  好多人都是直接下载Android Studio,但是如果只是做自动化的话只需要下载Android SDK就行了。

      下载地址:http://tools.android-studio.org/index.php/sdk/(推荐使用)

 

    2、解压后,里面有个SDK manager.exe双击打开

    3、勾选你要下载的API版本和对应的android版本,后面模拟器会用到(不下载用其它模拟器也行,或者真机),然后坐等下载。安装Tools下的Android SDK Platform-tools和Android SDK Build-tools,Android SDK Tools可以选择是否更新,建议直接更新。镜像:随便选个版本也可以选择多个版本安装,我喜欢直接连接真机进行,由于镜像比较大,所以喜欢真机的朋友们可以不下载镜像,GoogleFQ安装:Extras文件夹下所有的全部安装。

 

四、android-sdk环境变量

    1、在系统变量新建:ANDROID_HOME,对应变量值为:D:\software\android-sdk-windows(sdk安装路径)

    2、path添加两个变量,将以下箭头所指的两个文件路径添加到path里

    3、path里面添加D:\software\android-sdk-windows\tools和D:\software\android-sdk-windows\platform-tools,或者%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

五、adb环境

    1.因为adb是在D:\software\android-sdk-windows\platform-tools这个目录下的,所以上面添加了环境变量后,可以直接在cmd里面运行了。

   2.在cmd输入adb可以查看对应版本号

六、连接手机

    1.手机用数据线连电脑,如果安装了91助手或者360什么的可以先下载手机驱动,确认手机能连上

    2.打开cmd输入:adb devices,当屏幕上出现一串字符,后面显示devices说明连接成功(出现其它的提示,得检查自己的环境了)

到这里android的测试开发环境已经装好了,下一篇会教搭建搭建appium环境。安装过程中遇到各种奇葩问题,请卸载完后,仔细阅读,从第一行开始,一步一步走下来,中间任何一个环境出问题,都会导致最后appium运行失败。

在学习过程中有遇到疑问的,可以加appium(python+appium) QQ群交流:707699217

七、小结

1、搭建编译环境时为什么有时候要设置环境变量,而有时又设置用户变量? 

答:环境变量分为系统环境变量和用户环境变量。 你所说的环境变量是指系统环境变量,对所有用户起作用 。而用户环境变量只对当前用户起作用。 

Guess you like

Origin www.cnblogs.com/du-hong/p/10944333.html