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

[Python app automation test practice ③] - configuration and construction of appium environment under MAC system

編輯:Python
Wanyeji Faint thunder , Cloudy sky . But I hope the wind and rain will come , I can keep you here .


Preface
Author's brief introduction : Husky who yearns for power , You can call me Siberian Husky , One devoted to TFS - The whole stack Empowered bloggers
CSDN Blog expert certification 、 Nova plan Season 3 full stack track top_1 、 Huawei cloud sharing expert 、 Alibaba cloud expert Blogger
If there is something wrong with the knowledge of the article , Please correct me. ! Learn with you , Progress together
The motto of life : Being superior to some other man , Is not high , The true nobility is to be superior to one's former self .
If you feel the blogger's article is good , Please pay attention. 、 give the thumbs-up 、 Collect three companies to support bloggers


Column series ( Click unlock ) Learning route guidance Knowledge orientation Python Full stack white paper Zero foundation beginner level chapter Easy to get started in an easy to understand way , Let you fall in love with Python The charm of . Advanced Grammar Mainly around multi-threaded programming 、 Regular expression learning 、 Including project exercises close to actual combat . Office automation Realize the automatic operation of daily office software , Save time 、 Improve office efficiency . Automation test practice From the perspective of actual combat , One step ahead , Rapid transformation test development engineer . Database development practice Updating Introduction and practice of reptile Updating Data analysis Updating Introduction to the front +flask Full stack Updating django+vue Full stack Updating expand - Introduction to artificial intelligence Updating The road to network security Stepping on a pit Record the pit encountered during learning and drilling , It is convenient for those who come from behind to catch up Net security literacy Three days fishing , No deep understanding of the principle , It will only make you a script boy . vulhub The loopholes in the shooting range reappear Make it easy to reproduce vulnerabilities , Let security researchers focus more on the vulnerability principle itself . shell Programming Don't involve linux Basics , The final case will be in the direction of safety reinforcement . [ To be finished ] WEB Vulnerability attack and defense 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles Collection of penetration tools 2021 year 9 month 3 Stop updating on , Move to safe communities such as prophet community and small secret circles A little Engineer Test artifact - Charles Software test data packet capture analysis artifact Test artifact - Fiddler Learn to fiddle , Learn not to stand upside down and eat , Rarefied ! Test artifact - Jmeter Not just a performance test artifact , It can also be used to build a lightweight interface automation testing framework . RobotFrameWorkPython Automatic test tool realized , This chapter only introduces UI Automation part . Java Realization UI automation Document written in 2016 year ,Java Realized UI automation , It still has reference significance . MonkeyRunner There are not many application scenarios for this tool at present , The document has been deleted , Only for the sake of good typesetting .


List of articles

    • APPIUM brief introduction
    • install APPIUM The environment that needs to be prepared before
      • Check Java Environment installation and configuration
      • Check homebrew Whether to install
      • Check Android SDK Is the environment installed
      • install Xcode
    • APPIUM Environment building
      • install node.js
      • install appium server
      • install Appium-Python-Client
      • install appium-doctor Used to detect appium Whether the installation of is successful
    • install APPIUM Desktop applications ( namely Appium-Desktop)

Start using “APPIUM” Before scripting , The essential step is to build “APPIUM” The environment configuration of such a test framework . Compared with the interface test learned earlier 、WEB For setting up an automated testing environment ,“APPIUM” The environment is relatively complex .

The following environments need to be configured :

  • Construction of Android environment
    • Java Environment installation and configuration
    • Android SDK Construction of environment

  • APPIUM Some toolkits on which the tool itself depends
    • such as Node.js
    • such as APPIUM The tool itself

APPIUM brief introduction

Appium It's an open source 、 Cross platform test framework , It can be used to test Native App、 Hybrid applications 、 Move Web application (H5 application ) etc. , It is an important tool for Internet enterprises to realize mobile automation testing .

Appium、Appium-Desktop、Appium Client The difference between :

  • 1、Appium: yes Appium The core of the system , It is also a problem in itself web Interface services , Also known as appium server

  • 2、Appium-Desktop: It's to make Appium Can better use , Make it easier for Xiaobai to get started , Make debugging and interface analysis more convenient , Officially developed GUI Tools

  • 3、Appium Client:appium Just one. web Interface , Accept http request , Each language can encapsulate and send requests by itself

install APPIUM The environment that needs to be prepared before

Check Java Environment installation and configuration

* java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)


If not installed , Reference resources Mac In the environment Java JDK Installation and environment variable configuration of ( It's solved perfectly ) One article

Check homebrew Whether to install

* brew -v
Homebrew 3.5.2
Homebrew/homebrew-core (git revision 49d84ebfb3f; last commit 2022-06-15)
Homebrew/homebrew-cask (git revision 763a50c0b5; last commit 2022-06-15)


Homebrew Is a macOS Under the platform Missing package management tools , Own installation 、 uninstall 、 to update 、 see 、 Search and many other practical functions . If not installed , Reference resources Mac install homebrew Detailed tutorial One article

Check Android SDK Is the environment installed

test Android App need Android SDK .

* adb version
Android Debug Bridge version 1.0.41
Version 33.0.2-8557947
Installed as /usr/local/bin/adb


If not installed , Reference resources Mac Installation and configuration in the environment android sdk One article

install Xcode

test iOS App need .
open Finder, stay Applications Under the folder , See if there is any Xcode.app Program . without , You need to install .
Download address :https://developer.apple.com/downloads/
The installation method is the same as that of all dmg The installation method of the package is the same .

APPIUM Environment building

Mac System building appium There are two ways to change the environment :

1. Direct download appium.dmg Can run ( load dmg Package installation method , It's simple , And install all dmg The bag is the same , I don't know much about .)
2. Use npm Command to install , Next, I will mainly introduce how to pass npm How to install .

The specific installation steps are as follows :

> brew install node # install APPIUM Dependent environment of "node.js" ; Directly installed node It contains npm, And the path is correct , There is no correlation error 
> npm install -g cnpm --registry=https://registry.npm.taobao.org# Because the domestic wall is too high , So we need to use npm Taobao mirror image of 
> cnpm install -g appium # install appium
> appium -v # see appium Version of , Verify that the installation was successful 
> pip3 install Appium-Python-Client # install appium client 
> npm install wd # Two installations appium client Choose one of the ways 
# -------------------------------------------------------------------------------------------------------------
# Check appium Is the installation successful 
> npm install appium-doctor -g # install appium-doctor ; "appium-doctor" It's testing appium Whether to install a successful command 
> appium-doctor # testing appium Is the installation successful , When all that appears is "√" When no. , It means that the installation is completed 
> appium & # start-up appium , When the terminal appears ,

PS: install "node.js" And subsequent installation appium When , There are two possible comparison pits .

  • Upgrade first homebrew:brew update, To be able to install the latest version of node. When I first installed it , Because there is no upgrade brew, So pass brew install node Installed node The version is relatively low , Cause to use npm install appium Tips " ‘appnium’ is not in the npm registry."
  • Because the domestic wall is too high , So we need to use npm Taobao mirror image of npm install -g cnpm --registry=https://registry.npm.taobao.org . The image address is not unchanging , You need to verify the validity of the image address , Sometimes when you see this address , In fact, the address has expired .

install node.js

adopt brew At terminal perform brew install node install node.js ;

After the installation is completed, the terminal inputs node -v Check node.js Is the installation successful .



install appium server

utilize node Contains npm Execute at the terminal npm install -g appium install appium .

After the installation is completed, the terminal inputs appium -v Check appium Is the installation successful .



install Appium-Python-Client

Execute the installation command at the terminal pip3 install Appium-Python-Client



install appium-doctor Used to detect appium Whether the installation of is successful

The terminal executes the installation command npm install appium-doctor -g ,

After installation , Terminal execution appium-doctor testing appium Installation integrity of .


perform "appium-doctor" Check appium Installation integrity of


Poking fun at a ,"Xcode" This thing seems to be 12.8G Hard disk space for , It's too heartbreaking .


start-up appium , Carry out orders appium perhaps appium & ;

The difference between the two startup methods is appium The startup mode of can be through ctrl + c (mac yes control + z) closed ; and appium & You cannot force the shutdown by this command .



install APPIUM Desktop applications ( namely Appium-Desktop)

Visit the download link :https://github.com/appium/appium-desktop/releases/ Download the latest version of the installation package .




thus ,APPIUM The environment is set up !

I made a obeisance !




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