当前位置:网站首页>Appium introduction and environment installation
Appium introduction and environment installation
2022-06-24 21:05:00 【gchh_ spring】
appium frame :

appium Ecological tools
adb:Android Of debug Control tools , Used to get android All kinds of data and control
appium desktop: It's embedded qppium server and inspector Integrated tools for
appium server:appium Core tools of 、 Command line tools , by appium client Establish communication mechanism with mobile phones
appium client: Client encapsulation libraries for various languages , Used to connect to appium server, Support python、Java、ruby、robotframework-appium
appcrawler: Automatic traversal tool
appium Environmental installation -windows Environmental Science
Environment installation tools
Java 1.8 edition
android sdk
node js( Recommendation is greater than 10 edition ),npm( Greater than 6 edition , install nodejs I'll bring it later npm The tool ),npm Is a package management tool , Can pass npm To install appium server( My environment is direct installation appium desktop, Contains appium server, All not installed node js and npm)
python3: Use python Language writing , So you need to install python3 Environmental Science
appium desktop: For beginners , You can use this tool to complete script recording
appium python client: Use the client to complete the script writing
The above tools are all around appium From the three parts of , One client , One server End , A mobile terminal
To support the mobile terminal , Need to install jdk、android sdk
The client needs to be installed appium client
server The end needs to be installed node js and appium server Or is it appium desktop
Environmental installation steps -windows Environmental Science
1、 install JDK(1.8 edition )
Download from the domestic image source website jdk 1.8, And install :https://repo.huaweicloud.com/java/jdk/
Configure environment variables :
JAVA_HOME C:\Program Files\Java\jdk1.8.0_171 Pay attention to write yourself here java Installation path for
classpath .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar Notice that you put a dot and a semicolon at the beginning
path %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin path Add these two paths
Check java Is the environment well configured :
Go to the command line , Input java -version perhaps javac -version, The output of version number information is successful
2、 install Android SDK
1、 Download from the download address Android sdk:http://tools.android-studio.org/index.php/sdk
download Windows edition zip Package file sdk package , Download succeeded and unzip , open SDK Readme file , Then execute the command in the extracted path :tools\android.bat update sdk --no-ui, To update this sdk package , When asked whether to install, enter y.
install sdk, Actually sdk It's just a folder , After downloading, you need to update manually , With environment variables, you can use , No manual installation is required
The updated folder is placed in a stable path , And configure the environment variables , Generally not changed
Be careful : Some tools may fail to download when updating the package , It may have something to do with the Internet , You can try to run the above update command multiple times to solve the problem , Or buy an agent directly to solve the problem of network update

2、 Configure after successful installation android sdk environment variable :
ANDROID_HOME D:\android-sdk-windows Configure according to the actual path of your environment
PATH %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
3、 Check if the installation is successful , stay cmd Input adb perhaps adb shell, And then go back
If it shows adb Version information and usage of , The installation and configuration are successful
3、 install appium server perhaps appium desktop, You can choose one of the two to install
appium desktop: The actual is appium server+appium inspector Integration of the two tools , among inspector Is a tool that can be used for script recording and script export , Perfect for beginners , If you install this, you don't need to install appium server
appium server:appium The service side , If you only install this , Recommended npm Installation
Mode one : install appium desktop
Download the installation package of the corresponding operating system :
https://github.com/appium/appium-desktop/releases
What I installed myself was v1.15.1 Version of , Be stable , Download the corresponding installation package according to the operating system , After successful installation , open desktop

Click on Start Server start-up appium server: Start successfully as shown in the figure below

Mode two : Separate installation appium server
It is recommended to install an image provided by Taobao ,node js You need to load it first , Guarantee npm Package tools can use , To download cnpm Tools for , Reuse cnpm install appium
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install -a appium
installed appium after , Type... Directly on the command line appium function , Can display appium The version information and listening port information indicate that the installation is successful
4、appium client install
Depending on the client's choice of encoding language , You need to choose different client, Here is the use of python3 Language , So you need to install python Linguistic client
Use it directly pip Installation :pip install appium-python-client
Or in pycharm Directly install through the interface , After installation, see the figure below :

If import appium No report error , explain appium client Installation successful
5、( Optional ) Use appium-doctor The tool checks whether the environment has been installed
Use cnpm install appium-doctor Command to install doctor Tools , Be careful cnpm It should be installed in advance , See step 3 The instructions in
After the installation is successful, execute directly appium-doctor, I'll check it out appium Installation of associated tools , Some tools must be installed , For example android Automated testing , that ANDROID_HOME,JAVA_HOME,adb Must be installed
Verify that the environment is installed successfully
1、 Start by opening appium desktop perhaps appium server, Don't complain
2、 Prepare one android equipment , Real machine or simulator , Connect to the computer and use adb services See if it's connected , have access to mumu Simulator
adb Connecting device
【win edition 】
adb connect 127.0.0.1:7555
adb shell
【mac edition 】
adb kill-server && adb server && adb shell
3、 Finally, write the test script , Run script
from time import sleep
from appium import webdriver
desire_cap = {"platformName": "android",
"deviceName": "127.0.0.1:7555",
"appPackage": "com.xueqiu.android",
"appActivity": "com.xueqiu.android.common.MainActivity",
"noReset": 'true',
"dontStopAppOnReset": 'true',
"skipDeviceInitialization": 'true'
}
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desire_cap)
driver.quit()
边栏推荐
- Simpledateformat thread unsafe
- Leetcode(135)——分发糖果
- Sleep revolution - find the right length of rest
- It was Tencent who jumped out of the job with 26k. It really wiped my ass with sandpaper. It gave me a hand
- What does virtualization mean? What technologies are included? What is the difference with private cloud?
- Rename and delete files
- Responsibility chain mode -- through interview
- Combination mode -- stock speculation has been cut into leeks? Come and try this investment strategy!
- 顺序表的基本操作
- 主数据建设的背景
猜你喜欢

使用gorm查询数据库时reflect: reflect.flag.mustBeAssignable using unaddressable value

JMeter parameterization

红象云腾完成与龙蜥操作系统兼容适配,产品运行稳定
![[普通物理] 光栅衍射](/img/f3/965ff7cd3bb76b4f71b69b9d12ece3.png)
[普通物理] 光栅衍射

Apple, Microsoft and Google will no longer fight each other. They will work together to do a big thing this year

Material management system based on SSM (source code + document + database)

After idea installs these plug-ins, the code can be written to heaven. My little sister also has to arrange it

maptalks:数据归一化处理与分层设色图层加载
Talking about the range of data that MySQL update will lock

Prototype mode -- clone monster Army
随机推荐
Record a deletion bash_ Profile file
The Google File System (GFS) learning notes
C language to realize mine sweeping (simple version)
IDEA Dashboard
Bytebase joins Alibaba cloud polardb open source database community
[普通物理] 光栅衍射
Vant component used in wechat applet
Popupwindow touch event transparent transmission scheme
Difference between map and object
二叉树的基本性质与遍历
Static routing job
Camera rental management system based on qt+mysql
I just purchased a MySQL database and prompted that there are already instances. The console login instance needs to provide a database account. How do I know the database account.
yeb_ Back first day
Image panr
Does the developer want to change to software testing?
Bridging mode -- law firm
Mapstacks: data normalization and layered color layer loading
Adding subscribers to a list using mailchimp's API V3
"Super point" in "Meng Hua Lu", is the goose wronged?