当前位置:网站首页>Appium desktop introduction
Appium desktop introduction
2022-06-24 21:06:00 【gchh_ spring】
android Automation premise depends on
1、adb Tools : Dedicated to andriod A tool for automated testing
2、 Simulators or real machines
Simulator : NetEase mumu: For fixed android Version of the simulator , Only support android 6.0 The transformation of the version , If you need to use other Android versions , Can install genimotion and emulator
genimetion,emulator The simulator needs to be installed android studio,studio There is a simulator management tool , You can use this management simulator
Real machine : need root jurisdiction , download root Of apk, Real machine root, Real machine root Poor rear safety
3、appium desktop
appium desktop The main function
1、UI analysis
UI Sorting and analysis , Location and analysis of elements
2、 Record use case
3、 Element lookup and positioning
4、attach Existing session

1 Mark : open inspector Tools
2 Mark : download appium server Log information
3 Mark : close appium server
open inspector The interface behind the tool

Click the hyperlink in the lower left corner , You can open the following link address :https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
This page mainly introduces Desired Capabilities Property and value information of , Generally, mobile phones are divided into android And apple systems , Next, let's say android Take for example desired Capabilities
platformName: Platform name , The value is mainly :iOS, Android, or FirefoxOS
deviceName: Equipment name , Mobile devices have a unique name to distinguish them , When connecting multiple mobile devices , have access to adb devices Command to view the currently connected device name
If there are more than one , Multiple lists will be displayed
appPackage:only for android,app The name of the package , stay android Unique in the system , Set what needs to be tested app, Can pass adb Command get to
appActivity:only for android,app The name of each page in the , Set what needs to be tested app Which page in , Usually set to app Your home page or welcome page
noReset: The value is true, false,Don't reset app state before this session. Set to true No more data clearing and initialization app, Keep the last run data Information
fullReset: The value is true, false,Perform a complete reset

unicodeKeyBoard: Value :true or false, Whether you need to input a language other than English , If English is required , So set it to true
Enable Unicode input, default false
resetKeyBoard: Value :true or false, Whether the input method needs to be reset after the test is completed
Reset keyboard to its original state, after running Unicode tests with unicodeKeyboard capability. Ignored if used alone. Default false
other Desired Capabilities Property and parameter values of , Please refer to the official documents :
https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md
skipDeviceInitialization:true or false, skip app The initialization , The default is false
dontStopAppOnReset:true or false, Directly execute the operation when the application is started , No need to reboot app
How to get app The package name and activity Page information :
obtain app The package name 、activity
Method 1 :
mac:
adb logcat "ActivityManager:I *:s" | grep "cmp"
win:
adb logcat ActivityManager:I *:s | findstr "cmp"

Mark 1:appPackage
Mark 2:appActivity
Method 2 :
mac:adb logcat |grep -i displayed
win:adb logcat | findstr /i "displayed"
After entering the above command , Open the app, View the latest printed information

Mark 1:appPackage
Mark 2:appActivity
obtain app Information about
Get the current interface element :adb shell dumpsys activity top
Get task list :adb shell dumpsys activity activities
Start the application :
adb shell am start -W -n com.xueqiu.android/.view.WelcomActivityAlias -S
appium desktop establish session、 start-up app

As shown in the figure above , After obtaining all the information, enter the corresponding value , Click on the Start Session, You can start the set app
The first start will be slow , After startup, as shown in the figure below :

Mark 1: Click the refresh button , Refresh inspector Get the simulator page
left : The page display of the current mobile page
middle : Page dom structure , Where the element is located
On the right side : When the element is selected on the left , The details of this element will be displayed on the right , Element attribute information, attribute value, etc

upper : Selected elements , Sliding operation , Click on the action , Return operation , Refresh , Recording , Search element , Copy , close session
appium inspector Simple element positioning
Several common positioning methods :id,accessibility_id
1、driver.find_element_by_id(resource-id), there id Refer to resource-id, As shown in the figure below id Values and resoruce-id Agreement

2、driver.find_element_by_accessibility_id(content-desc), there accessibility_id Refer to content-desc The value of the property
边栏推荐
- List set Introduction & common methods
- Requests requests for web page garbled code resolution
- 科创人·味多美CIO胡博:数字化是不流血的革命,正确答案藏在业务的田间地头
- Postman assertion
- CVPR 2022 remembers Sun Jian! Tongji and Ali won the best student thesis award, and hekaiming was shortlisted
- Bytebase joins Alibaba cloud polardb open source database community
- How to enhance influence
- Basic properties and ergodicity of binary tree
- Visitor model -- generation gap between young and middle-aged people
- Simulation lottery and probability statistics experiment of the top 16 Champions League
猜你喜欢

Shrimp skin test surface treated

Material management system based on SSM (source code + document + database)

Difference between map and object

Berkeley, MIT, Cambridge, deepmind and other industry leaders' online lectures: towards safe, reliable and controllable AI

How to apply agile development ideas to other work

Create a multithreaded thread class
Talking about the range of data that MySQL update will lock

Byte and Tencent have also come to an end. How fragrant is this business of "making 30million yuan a month"?

Visitor model -- generation gap between young and middle-aged people

"Super point" in "Meng Hua Lu", is the goose wronged?
随机推荐
Analysis of errors in JSON conversion using objectmapper
When querying the database with Gorm, reflect: reflect flag. mustBeAssignable using unaddressable value
Mr. Hu Bo, CIO of weiduomei, a scientific innovator: digitalization is a bloodless revolution, and the correct answer lies in the field of business
图像PANR
Reflection - class object function - get method (case)
传统的IO存在什么问题?为什么引入零拷贝的?
Vant component used in wechat applet
How to apply agile development ideas to other work
Why do we always "give up halfway"?
JUnit unit test
Image panr
Undo log and redo log must be clear this time
Leetcode(455)——分发饼干
A/b test helps the growth of game business
Selenium crawl notes
After 5 months' test, it took 15K to come for an interview. When I asked, it was not worth even 5K. It was really
What are the problems with traditional IO? Why is zero copy introduced?
Power apps Guide
Responsibility chain mode -- through interview
Common data model (updating)