Automated testing for Appium entry - first understanding of Appium and installation and configuration

Getting to know Appium and its installation and configuration

foreword

Yesterday I said that I started to push the Appium series of tutorials, and I also took time out of my busy schedule to update. I hope that all friends will support and forward a lot. Let us learn together and grow together. It takes 5 minutes to read this article and maybe 30 minutes to do it yourself.

Appium/Introduction

Appium is an open source cross-platform support for multiple development languages ​​to test Native/Hybrid/Web Android/iOS Application automated testing framework, using the web driver protocol. Not only supports emulator but also supports real machine testing.

Appium/environment preparation (Windows)

Install JDK and set environment variables

  1. Add JAVA_HOME the corresponding path C:\Program Files\Java\jdk1.7.0_79

  2. PATHappend  at the end of the variable;%JAVA_HOME%/bin;

  3. Add CLASSPATH, set the value to%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar

  4. After setting, enter on the command line java -version

    The following content is displayed to indicate that the configuration is correct

java version "1.7.0_79"<br> Java(TM) SE Runtime Environment (build 1.7.0_79-b15)<br> Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

Install the Android SDK and set environment variables

  1. Go to the Android official website to download and install the SDK

  2. set environment variables

    1. Add ANDROID_HOMEthe setting value as:C:\你的安装路径\Android\sdk

    2. Append at paththe end of the environment variable value:;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;

Enter it on the command line after setting adb devices. If the result is as follows, the configuration is successful:

List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

Install Nodejs

Go to Nodejs official website to download the latest version of NodeJs and install it directly.

After the installation is complete, open the command line and enter node -v, if a message similar to the following appears, the installation is successful.

v4.0.0

Appium/install

  • Install Appium using npm (management and distribution tool for Node js)

  • Install using the Appium official installation package

It is relatively complicated to install npm on windows, so it is recommended to use the official installation package.

Install Appium using NPM

First of all, the default mirror address of npm has been blocked, we need to change the download address of npm to a domestic address.

Open a terminal (command line), enter

npm config get registry

We can see the mirror address of the current npm.

We need to replace this address with a domestic address, here we replace it with Taobao's NPM mirror source:

npm config set registry=https://registry.npm.taobao.org/

After hitting enter, we enter again

npm config get registry

You can confirm whether the mirror source is replaced successfully.

Next we can install Appium:

npm install -g appium

It should be noted that during the installation process of the latest version of Appium, it will go to Google to pull the latest chromedriver, because Google is blocked, you may not be able to download it. It is strongly recommended that you learn how to climb over the wall.

verify installation

After confirming that Appium is installed, we can use appium-doctorthe command to check whether the current appium installation is complete and whether the current JDK, SDK and other environments are configured correctly.

If appium-doctorthe returned content is wrong, please complete your environment according to the specific prompts returned.

If the returned results are similar to the following, the installation is successful

     ...
     ...
     Android Checks were successful.
     All Checks were successful

It should be noted that if you installed through the installation package, appium-doctor you must switch to  C:\Program Files (x86)\Appium\node_modules\.bin the directory when using the command

Relevant information

The following is the supporting information. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/myh919/article/details/131831228