? 2.1 Basic Environment Construction
When we learn a new technology is basically starting from the environment, this book in addition to the first chapter is also, if you even the most basic environment is not so we do not need to say too much, about the introduction:
1, because Appium is supported for Android and iOS automation, but iOS automation is not able to run on the Windows machine, so if you want to both have a Mac, of course, it can also be a black Mac.
2. What are the basic environments you need to configure on your Mac? Let's look at a picture below to see
The environment in the above image includes both iOS and Android environments, if we only need one or just like Windows systems to support Android then there is no Xcode column, so all we need to focus on is ANDROIDSDK, JDK, All that is left is to configure these two environment variables. Let's take a look at how these two environments are built and have a foundation to skip directly, after all, from the beginning we need to consider the course completely without foundation.
2.1.1 Java Environment setup
1, direct Baidu to download the JDK installation package, click to install, all the default installation is good
2, configure the environment variables, if you are a Windows computer this very good configuration, Baidu understand the line, the Mac is a little more complex, you need to go through the command line into the. bash_profile file, directly in your root directory into the good, configuration results look at the picture below us
We only need to configure the configuration of the java_home and then introduce the java_home into it, and add it in path as well.
At the end of the Mac, don't forget to reintroduce the. bash_profile file
2.1.2 ANDROIDSDK Environment Construction
1, to Baidu download androidsdk compressed files, you can also use the online: http://mac.softpedia.com/get/Developer-Tools/ google-android-sdk.shtml this address download (because the country to visit the official website download will be relatively slow, so suggested that the network disk download, follow-up I will organize the address, but also recommended to learn FQ, after all, many problems of the solution of Google search is more accurate than Baidu)
2, after downloading the files (double-click or use the command line decompression, the Windows version of the SDK now only need you to extract the directory of tools in the absolute path to the environment variable in the path in the line, check whether it takes effect after the input android-h as long as the error stating that you have succeeded. Mac's next look)
3, through the terminal into the Tools directory, enter the./android SDK, a box pops up,
This is the graphical interface of the SDK, select Android SDK Manager---Preferences in the graphical interface, fill in the "HTTP proxy server" here: mirrors.neusoft.edu.cn. This address is a domestic mirror server, if you can FQ also can use foreign, no difference. Port write 80, and then put the force https://before the hook. Look at the following picture:
4, Mac top menu Tools->manage add-on Site, select New in the dialog box,
In the edit box, type:
Http://mirrors.neusoft.edu.cn/android/repository/addon-6.xml
Http://mirrors.neusoft.edu.cn/android/repository/addon.xml
Http://mirrors.neusoft.edu.cn/android/repository/extras/intel/addon.xml
Http://mirrors.neusoft.edu.cn/android/repository/sys-img/android-tv/sys-img.xml
Http://mirrors.neusoft.edu.cn/android/repository/sys-img/android-wear/sys-img.xml
Http://mirrors.neusoft.edu.cn/android/repository/sys-img/android/sys-img.xml
Http://mirrors.neusoft.edu.cn/android/repository/sys-img/google_apis/sys-img.xml
Http://mirrors.neusoft.edu.cn/android/repository/sys-img/x86/addon-x86.xml
Http://mirrors.neusoft.edu.cn/android/repository/addons_list-2.xml
Http://mirrors.neusoft.edu.cn/android/repository/repository-10.xml
All of the above addresses need to be added manually, and then selected for download directly. If there is an error in the period can Baidu, or ask me, in the end of the article I will share my contact information, we learn together.
2.2 Python Environment Setup
The Python environment is installed by default on the Mac computer, so there is no statement here, the need to install the Python environment under Windows Baidu Download an installation package and install it directly next. After installation, you will need to add the Python installation path in the environment variables. Verify that the installation is successful after you enter the terminal: Python. If there is no error, OK.
2.3 Appium Environment Construction
Environment prepared so much, now is the highlight of our play. A little bit about appium should know that in fact he is based on selenium, so our environment is essential to have selenium, he is only part of it, there are other important members. Let's take a look at their relatives.
1, Appium This is we need to learn not much introduction
2. Pip understands as Python's butler, and he is responsible for installing and managing Python-related packages tools
3, selenium the first web Automation testing framework (and fourth two select one can)
4, appium-python-client in short, you operate Appium is called to call him inside some methods to call, if it is based on other languages, the information page will be relatively different.
5. Node. js simply is that node. js created the Appium, so node. JS is needed to parse his
Let's install it now, and first we'll install the easiest
1, node. js mac generally comes with, if there is no direct Baidu download client, the default installation can (also under the Windows computer)
2, Pip Mac under if your Python version is newer, the default is to install the PIP, if not installed directly in the Terminal input command: sudo easy_install pip installation can be. You can also download a source code to install.
3, Appium mac and windows have two kinds of installation mode, one is through the client installation, one is the terminal installation, here say the difference:
Do automation is certainly not just on a machine to do automation, because that meaning is not very big, so many times we are linked to multiple computers to execute, but appium to link more than one computer need to start a number of appium services, if you install is installed through the client to install, You link more than one machine need to start multiple times, configured multiple times, so that your computer itself is a performance test. If you are installing through a terminal command at startup you only need to start multiple services with a command. Why is this so much, because once the author is doing a project unity AH machine on the Appium client started 5, long-running case after the Appium service will automatically hang up, but through the terminal installation to start more than 10 services, while running still no problem. This is my experience is not necessarily all right, readers can choose according to their hobbies.
Appium Client Installation:
(1) Go to the official download: http://appium.io/relatively slow
(2) Domestic download: Http://pan.baidu.com/s/1jGvAISu (thief fast, recommended)
Now install the package directly after the Fool-type installation, everything next, by default. (Same as Windows)
Appium Terminal Installation:
Directly in the terminal Input command: NPM install-g appium. (Remember not to use sudo to do) in the installation process without error, you installed successfully, error also do not worry, can Baidu solve, can also contact me. Appium command Install the default is to go abroad to request, because n many reasons you failed, so recommended to use the following command to access the domestic image installation NPM--registry http://registry.cnpmjs.org install-g appium After successful input Appium will prompt: Welcome to Appium instructions installed successfully.
4, Appium-python-client introduced before, this and selenium they two choose one good, suggest choose this, his method also need a bit more. Install via the command: sudo pip install appium-python-client. Check whether the installation can be entered in terminal: Python, enter the from Appium import webdriver in the Python command input box, and if no error is indicated you are also installed successfully.
Write here our basic environment has been installed, and some people may ask you Jenkins, ant, maven or not install it? In fact, I would like to say that in the basic part we have done here already enough, because I say in the basic part of too many things may be some relatively weak base readers will not understand, and in the article I have said a lot of nonsense, so please have the basic reader forgive me.
2.4 Appium Environment Construction thought 2.4.1 thinking how to construct the environment thought diagram
See here's small partners may be surprised, why this chapter? Haha, because in the course of online teaching found a lot of small partners actually told once, actually still can't fix, so increased.
First we need to take care of an environment, here, whether it is appium, or selenium or other automation, development environment we can follow this idea, first you need to know what the framework is to do? Then his whole workflow or the whole framework of his dependencies on the software is what. It doesn't matter here, we look back at the front of the appium environment, here take Windows said.
1, Appium environment is not need to appium an installation package? (Do not install first)
2. We test for Android do we need an Android SDK for Android itself?
3, Android itself is the basis of Java, we do not need to configure the Java JDK?
4. Appium is a node. js developer, is his dependency a node. JS installation package?
5, since we want to do automation is the need to choose a development language, here Python so we do not want to install Python?
6. How does python interact with Appium? So do we need a third-party extension package for a appium-python-client?
7, 工欲善其事 its prerequisite, we are not to choose a good code Editor IDE, haha, sublime I choose here.
All right, is this the whole idea in your head? Then we can follow this idea to a perfect it? Building the environment starts with the basics, so does our first step be the JDK, then the SDK, then node, then Python, Appium, appium-python-client, editing software? So it's important to organize your ideas.
Appium Python Automation Test series Appium Environment Construction (II.)