程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[Python automated test 32] establishment of APP automated environment

編輯:Python

List of articles

  • One 、 Preface
  • Two 、 Installation and environment construction teaching
    • 2.1 Environment depends on
    • 2.2 appium Program installation
    • 2.3 appium-python-client
    • 2.4 Simulator installation
    • 2.5 java jdk install
    • 2.6 Android SDK Environmental Science

One 、 Preface

This article mainly explains App Build an environment for automated testing , stay App Build an automated test environment , There are many pits , It's easy to install errors , Come and study with the author , In addition, there is a portal for a series of articles below , It's still being updated , Interested partners can also go to check , Don't talk much , Let's have a look ~

Series articles :
Series articles 1:【Python automated testing 1】 meet Python The beauty of the
Series articles 2:【Python automated testing 2】Python Installation configuration and PyCharm Basic use
Series articles 3:【Python automated testing 3】 First knowledge of data types and basic syntax
Series articles 4:【Python automated testing 4】 Summary of string knowledge
Series articles 5:【Python automated testing 5】 List and tuple knowledge summary
Series articles 6:【Python automated testing 6】 Dictionary and collective knowledge summary
Series articles 7:【Python automated testing 7】 Data operator knowledge collection
Series articles 8:【Python automated testing 8】 Explanation of process control statement
Series articles 9:【Python automated testing 9】 Function knowledge collection
Series articles 10:【Python automated testing 10】 File basic operation
Series articles 11:【Python automated testing 11】 modular 、 Package and path knowledge collection
Series articles 12:【Python automated testing 12】 Knowledge collection of exception handling mechanism
Series articles 13:【Python automated testing 13】 class 、 object 、 Collection of attribute and method knowledge
Series articles 14:【Python automated testing 14】Python Basic and advanced exercises of automatic test
Series articles 15:【Python automated testing 15】unittest The core concept and function of test framework
Series articles 16:【Python automated testing 16】 Test case data separation
Series articles 17:【Python automated testing 17】openpyxl Secondary packaging and data driven
Series articles 18:【Python automated testing 18】 Configuration file analysis and practical application
Series articles 19:【Python automated testing 19】 Log system logging Explain
Series articles 20:【Python automated testing 20】 Construction of interface automation test framework model
Series articles 21:【Python automated testing 21】 Interface automation test practice 1 _ Interface concept 、 Project introduction and test process Q & A
Series articles 22:【Python automated testing 22】 Interface automation test practice II _ Interface framework modification and use case optimization
Series articles 23:【Python automated testing 23】 Interface automation test practice III _ Dynamic parameterization and data forgery
Series articles 24:【Python automated testing 24】 Interface automation test practice IV _Python Operating the database
Series articles 25:【Python automated testing 25】 Interface automation test practice 5 _ Database assertion 、 Interface Association and related management optimization
Series articles 26:【Python automated testing 26】 Interface automation test practice 6 _pytest frame +allure Explain
Series articles 27:【Python automated testing 27】Web Automated testing theory 、 Environment construction and common operations
Series articles 28:【Python automated testing 28】html Basic grammar
Series articles 29:【Python automated testing 29】Xpath、 Axis operation and CSS Detailed explanation of element positioning
Series articles 30:【Python automated testing 30】Web The three waiting and switching of automation
Series articles 31:【Python automated testing 31】Web Automatic mouse and keyboard operation 、select usage

Two 、 Installation and environment construction teaching

2.1 Environment depends on

To be able to App automated testing , The first task is to build the environment first ,App The environmental dependence of automated testing can be roughly divided into the following points ( First understand , The next steps will be introduced to ):

1、Appium service
2、Appium-Python-Client
3、 Real phone or Simulator – Common simulator : The thor 、MuMu、 Thunder and lightning 、 Free and easy 、 Tencent mobile assistant 、genymotion etc.
( Need developer mode +USB Debug mode )
4、java jdk 1.8+,64 position
5、Android Environmental Science ,adt-bundle

2.2 appium Program installation

Go directly to the official website to download the new version : Jump to the official website , After entering the official website, select Download Appium, Click to jump to Github And display the corresponding system version , Select a version you need to download , You can also enter Tags Download the historical version :


The detailed installation process will not be introduced here , But special attention needs to be paid to :

When installing, you will be asked whether to install the current user or all users , For novices or students who have just come into contact , It is strongly recommended to select the current user , Students who have selected all users can uninstall and reinstall , The main reason is that it is likely to be used by Appium service , Because of the problem of authority , Can't use , There are other pits , Not one by one

Appium The installation of is the direct default installation of the specified location , There is no corresponding path selection , This is the same as Google browser , We need to remember Appium Installation position of , You can locate the target location through system search or shortcut

After installation, the following interface will be displayed after startup , Because the author has already installed , If it is a new installation , You can also see the latest version below , default Host It can be shown that ,Port The default is 4723 port ,Python For 4444 port , Either way , The premise of use is to ensure that the port is not occupied or controlled by other service programs , Click on Start Server Button , To start the service :

Say welcome to... On the interface Appium, edition v1.21.0, The bottom shows that this port is being used , We try to access this service through a browser :http://localhost:4723/
The returned data is :{“status”:9,“value”:{“error”:“unknown command”,“message”:“The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource”,“stacktrace”:""}}
The returned data tells us that the visit was successful , So... For now Appium Has been successfully installed .

2.3 appium-python-client

appium-python-client Namely Python package , We go through Python The code sends some instructions through http Send form to appium Server side , And then you need this Python package , We can do it in Pycharm Pass through pip Command to install pip install appium-python-client

2.4 Simulator installation

If you have a real machine , Then use it directly , If you want to use a simulator , Then it is recommended to install a lightning protection device 、 Night God, etc , It is no different from normal software installation , After installation, you can go to the next step

2.5 java jdk install

install java jdk Baidu search and install directly , After installation, you need to configure environment variables , Specific information will not be listed , A few details to pay attention to :

JDK Version must be in 1.8 Version above and 64 position
Try to download a higher version
Slow download , Huawei image can be used

2.6 Android SDK Environmental Science

The last step is Android SDK Environmental Science , We can download it by installing the novice development integration package : Download jump
Installation procedure , The author will not introduce in detail here , You can refer to some articles of Baidu , After the installation and configuration is completed, the system will be installed in cmd Input in adb, If the corresponding content is displayed, you can confirm that the installation is successful


All right. ~ The above is all the content shared in this article , Have you learned ? I hope I can help you !



  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved