当前位置:网站首页>Appnium (I) basic use of appnium
Appnium (I) basic use of appnium
2022-06-12 14:28:00 【Makasa】
Preface
This chapter focuses on Appnium The basic application of
scene : in the light of app Conduct UI automated testing , Corresponding pc The end can use selenium Conduct automated tests
Premise : need Build first adb The environment and jdk Environmental Science , Relevant blogs have already mentioned the specific construction methods , I will not repeat the description here
adb Environment building (blog The first part ):https://blog.csdn.net/Makasa/article/details/120312644?spm=1001.2014.3001.5501
jdk Environment building (blog The second part ):https://blog.csdn.net/Makasa/article/details/107558070
One 、 download appnium
- Official website :https://github.com/appium/appium-desktop/releases/tag/v1.15.1


Two 、 Operation and use
1、 To configure appnium Running environment




2、 Configure basic equipment information
- Here is the simulator for direct use , So the configured simulator information

json Body can be copied directly , Then change the value to the configuration information of your own model
{
"platformName": "Android",
"platformVersion": "10",
"deviceName": "PBCM10",
"appPackage": "com.dingjian",
"appActivity": "com.dingjian.common.framework.MainActivity"
}
2.1) Attributes key The meaning of and how to obtain
2.1.1)platformName: The statement is ios still Android System
2.1.2)platformVersion:Android Kernel version number , You can view... By command
adb shell getprop ro.build.version.release

- 2.1.3)deviceName: The name of the connected device , You can view... By command
# take model Value
adb devices -l

2.1.4)appPackage:apk The package name
2.1.5)appActivity:apk Of launcherActivity, Check... By command ( Premise : You need to open the mobile app first )
# Both the package name and the running activity can get
adb shell dumpsys activity | findstr “mResume”

3、 Introduction to basic operation and buttons

3、 ... and 、 Script example
# This sample code uses the Appium python client
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
# Sign in
from appium import webdriver
# Global configuration
caps = {}
caps["platformName"] = "Android"
caps["platformVersion"] = "7.1.2"
caps["deviceName"] = "LIO_AN00"
caps["appPackage"] = "com.dingjian"
caps["appActivity"] = "common.framework.GetUniqueCodeActivity"
caps["ensureWebviewsHavePages"] = True
driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)
el2 = driver.find_element_by_id("com.android.packageinstaller:id/permission_allow_button")
el2.click()
el3 = driver.find_element_by_id("com.dingjian:id/input_unique_code_edtitext")
el3.send_keys("3001")
el4 = driver.find_element_by_id("com.dingjian:id/want_to_apply_for")
el4.click()
el5 = driver.find_element_by_id("com.dingjian:id/login_username")
el5.send_keys("zjl")
el6 = driver.find_element_by_id("com.dingjian:id/login_btn")
el6.click()
边栏推荐
- The original Xiaoyuan personal blog project that has been around for a month is open source (the blog has basic functions, including background management)
- Llvm 13.1 new pass plug-in form [for win]
- Codeforces Round #798 (Div. 2)(A~D)
- Huawei equipment is configured with H virtual private network
- Two months' experience in C language
- Is Shell Scripting really a big technology?
- C语言中主函数调用另外一个函数,汇编代码理解
- The difference between parameter and argument in C language
- How to use Android studio to create an Alibaba cloud Internet of things app
- Player actual combat 16 xdecode class
猜你喜欢

Design of PLC intelligent slave station based on PROFIBUS DP protocol

SystemC common errors

注重点击,追求更多用户进入网站,可以选择什么出价策略?

Server concurrency - note 1
![[early knowledge of activities] list of recent activities of livevideostack](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[early knowledge of activities] list of recent activities of livevideostack

Redis core configuration and advanced data types

TestEngine with ID ‘junit-vintage‘ failed to discover tests

For cross-border e-commerce, the bidding strategy focusing more on revenue - Google SEM

Player practice 15 xdemux and avcodecparameters

Reverse order of Excel
随机推荐
Unit test (I) unit test with JUnit
atomic and exclusive operation
How to realize the bidding strategy that pays more attention to transformation in the company's operation Google sem
Two methods of QT using threads
C语言中主函数调用另外一个函数,汇编代码理解
Des File Encryptor based on MFC framework
完美收官|详解 Go 分布式链路追踪实现原理
【OCR】AspriseOCR C# 英文、数字识别(中文不行)
Reverse the encryption parameters of a hot water software
Array one
Player actual combat 12 QT playing audio
【OCR】AspriseOCR C# 英文、數字識別(中文不行)
chapter19 Allocation
你敢信?开发一个管理系统我只用了两天
Implementation and debug of process hiding under x64
Design of PLC intelligent slave station based on PROFIBUS DP protocol
如果要打造品牌知名度,可以选择什么出价策略?
Postgresql14 installation and use tutorial
Leetcode 2185. 统计包含给定前缀的字符串
Player actual combat 16 xdecode class