当前位置:网站首页>Details of appium key knowledge
Details of appium key knowledge
2022-07-01 14:17:00 【Wu Daxi】
One 、capability Instructions
Appium Official website configuration description
1、 Common part
2、Android alone possess
3、ios alone possess
4、 Common ways to obtain configuration information
- obtain
deviceName
adb devices
- obtain
appPackage
andappActivity
adb shell
dumpsys activity | grep mFocusedActivity
Two 、appium How elements are positioned
1、 priority :
Generally, the order of selecting the location method is as follows id location >accessibility_id location >class location >xpath location >tap location .
2、 Positioning mode :
1、 adopt resource-id location
driver.find_element_by_id()
2、 adopt class_name location :class
driver.find_element_by_class_name()
3、 adopt accessibility_id location :content-desc
driver.find_element_by_accessibility_id()
4、 adopt xpath location
driver.find_element_by_xpath()
5、 adopt tap Simulate finger click positioning
Format :driver.tap()
Example :driver.tap([(60,138)],300) Pay attention to the format inside ( The first parameter is the list , In the list is Yuanzu )
explain : The first is positions, yes list Type up to five points ,duration It's duration , Unit millisecond
The tool below is SDK Self contained java Developed uiautomatorviewer, If you install it jdk, stay sdk Catalog \tools\bin Next Yes uiautomatorviewer.bat Double-click to open
6、uiautomator location
7、toast location
Toast yes Android A mechanism for displaying information in , and Dialog The difference is ,Toast There is no focus , and Toast The display time is limited , It will disappear automatically after a certain time .
The first parameter : The current context . You can use getApplicationContext() perhaps getContext() or this.
The second parameter : String to display . But R.string Middle string ID.
The third parameter : The length of time displayed .Toast There are two by default LENGTH_LONG( Long 3.5 second ) and LENGTH_SHORT( short 2 second ), Milliseconds can also be used, such as 1000ms( Don't suggest ).
8、 other
3、 ... and 、webview
1、webview brief introduction
We usually use a browser to browse the web , You know very well that you are using the browser , Or PC client , Or on the phone app. however webview Is an embedded browser , Embedded in native applications , You may not even realize you're using a browser .
2、 Environmental preparation
3、 How to judge whether a page is webview
4、 other
Four 、 Device interaction API
- Analog call :driver.make_gsm_call(‘13612312312’,GsmCallActions.CALL), Import required GsmCallActions library ;
- Simulated text messaging :driver.send_sms(‘13612312312’, ‘hello appium apis’)
- Simulate network settings :
Network settings category :driver.set_network_connection(connection_type: int)
- Screen capture operation :self.driver.get_screenshot_as_file(’./photos/img.png’)
- Record the screen of mobile phone :
Only support Android8.0 Above version , And some mobile phones, such as Huawei, do not support
self.driver.start_recording_screen()
self.driver.stop_recording_screen()
def test_mobile(self):
# Analog phone call
self.driver.make_gsm_call('13612312312', GsmCallActions.CALL)
# Simulated text messaging
self.driver.send_sms('13612312312', 'hello appium apis')
# Simulate network settings , Set to flight mode
self.driver.set_network_connection(1)
sleep(3)
# Simulate network settings , Set to data mode
self.driver.set_network_connection(4)
# Get the screenshot and save it to the path
self.driver.get_screenshot_as_file('./photos/img.png')
""" Carry out screen recording operation 1. Start recording 2. Stop recording 3. Only support Android8.0 Above version , And some mobile phones, such as Huawei, do not support """
self.driver.start_recording_screen()
self.driver.stop_recording_screen()
边栏推荐
- After being laid off for three months, the interview ran into a wall everywhere, and the mentality has begun to collapse
- phpcms实现订单直接支付宝支付功能
- Research Report on the development trend and competitive strategy of the global CCTV robot industry
- Summary of leetcode's dynamic programming 5
- 【 剑指 Offer】55 - I. 二叉树的深度
- Research Report on the development trend and competitive strategy of the global traditional computer industry
- sqlilabs less-11~12
- Is it reasonable and safe for securities companies to open accounts for 10000 free securities? How to say
- 程序设计的基本概念
- Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
猜你喜欢
Play with grpc - communication between different programming languages
Tdengine connector goes online Google Data Studio app store
Liu Dui (fire line safety) - risk discovery in cloudy environment
Station B was scolded on the hot search..
Leetcode (69) -- square root of X
Texstudio tutorial
sqlilabs less13
sqlilabs less-8
sqlilabs less9
Using CMD to repair and recover virus infected files
随机推荐
算网融合赋能行业转型,移动云点亮数智未来新路标
我们该如何保护自己的密码?
QT社团管理系统
[anwangbei 2021] Rev WP
被裁三個月,面試到處碰壁,心態已經開始崩了
Effet halo - qui dit qu'il y a de la lumière sur la tête est un héros
C language course design topic
Journal MySQL
Provincial election + noi Part 10 probability statistics and polynomials
Etcd summary mechanism and usage scenarios
玩转MongoDB—搭建MongoDB集群
sqlilabs less-11~12
[repair version] imitating the template of I love watching movies website / template of ocean CMS film and television system
Distributed dynamic (collaborative) rendering / function runtime based on computing power driven, data and function collaboration
SWT / anr problem - how to open binder trace (bindertraces) when sending anr / SWT
The integration of computing and Internet enables the transformation of the industry, and the mobile cloud lights up a new roadmap for the future of digital intelligence
2022年PMP项目管理考试敏捷知识点(6)
Fiori applications are shared through the enhancement of adaptation project
使用 Lambda 函数URL + CloudFront 实现S3镜像回源
光環效應——誰說頭上有光的就算英雄