当前位置:网站首页>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()
边栏推荐
- QT to realize the simple use of SQLite database
- Remote code injection
- QT link error: undefined reference to VTable for "XXX“
- QT database realizes page turning function
- Player actual combat 13 create qtopengl project to promote window control and reload qoopenglwedge
- Mémoire de l'examen d'entrée à l'université
- Shell notes
- 【活动早知道】LiveVideoStack近期活动一览
- C secret arts script Chapter 2 (detailed explanation of pointer) (Section 1)
- C magic skill Chapter 4 (detailed explanation of memory function)
猜你喜欢

Shell脚本到底是什么高大上的技术吗?

高考回憶錄

QT to realize the simple use of SQLite database

【OCR】AspriseOCR C# 英文、数字识别(中文不行)

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

Redis核心配置和高级数据类型

C語言中主函數調用另外一個函數,匯編代碼理解

chrome://tracing Performance analysis artifact

高考回忆录

WinDbg preview debug analysis createtoolhelp32snapshot
随机推荐
Des File Encryptor based on MFC framework
Visual studio common shortcuts
chapter19 Allocation
Llvm 13.1 new pass plug-in form [for win]
If you want to build brand awareness, what bidding strategy can you choose?
新技术:高效的自监督视觉预训练,局部遮挡再也不用担心!
Perfect ending | detailed explanation of the implementation principle of go Distributed Link Tracking
Program analysis and Optimization - 6 loop optimization
QT link error: undefined reference to VTable for "XXX“
华为设备配置BGP AS号替换
C secret arts script Chapter 2 (detailed explanation of pointer) (Section 2)
[ROC] aspriseocr C # English, Digital identification (not Chinese)
Wait function in SystemC
Configuring OSPF pseudo connection for Huawei devices
QT multi thread drawing and real-time refreshing method
SystemC time
如果要打造品牌知名度,可以选择什么出价策略?
[MySQL] basic database operation
Analysis of two-dimensional array passing as function parameter (C language)
Communication flow analysis