当前位置:网站首页>App automated testing appium Tutorial Part 1 - advanced supplementary content
App automated testing appium Tutorial Part 1 - advanced supplementary content
2022-06-28 08:10:00 【zhizhi0920】
app automated testing appium Outside the tutorial 1—— Advanced supplement
blend app test
blend app, That is, a app It doesn't just contain native parts , Also embedded h5 Webpage .
Use appium Framework for Android hybrid app To test , You need to switch from native to h5 Webpage ,
You must switch to the corresponding webview, The steps are as follows :
1. open app Inside webview debug Pattern
Method 1 :app Modify... In code
app What's in the code WebView A static method is called in the class setWebContentsDebuggingEnabled:
webView.setWebContentsDebuggingEnabled(true);
Method 2 : Force on Android webview debug Pattern
Because method 1 needs to find the developer to modify the code , More trouble , And when tested in a formal environment , Turn on debug Patterns can easily cause program instability , Therefore, method 2 can be used , Force on Android webview debug Pattern
notes : This method requires root, Therefore, it is recommended to use... In the simulator
step :
1)root equipment
mumu Simulator : Set up the center - Basic settings -root jurisdiction - Check open 

2) install xposed frame
xposed Download address
3) install xposed webview debugging modular
xposed webview debugging Download address
find “…\WebViewDebugHook-master\app\release\app-release.apk” install
4) take 2) and 3) Install to mumu Simulator
5) Activate Xposed
(1) open Xposed Installer
(2) install / Click... At the update ( The picture shows the installed )
(3) Check... In the module WebViewDebugHook
2. Verify if it is mixed app
Print out the current mobile page contex(python, Later Wen Tong )
print(driver.contexts)
If you return two elements, one ’NATIVE_APP’, One ’WEBVIEW’, The description contains h5 page
3. Switch to H5 page
driver.switch_to.context(‘WEBVIEW’)
Check if the switch is successful
print driver.current_context
4. Switch back to native app
driver.switch_to.context(‘NATIVE_APP’)
5. chrome debugging Webview
Open Google browser , stay Chrome://inspect debug
Pay attention to make sure that the webview Version and appium Medium chromedriver To correspond
Author's speech :
I failed in this step , In theory, it should be converted into H5 After the page , In the Chrome://inspect See the simulator H5 Page information , But I forced it open Android webview debug After the model , Input >print(driver.contexts) When verifying , No, “webview” Back to ,Chrome://inspect I can't see the simulator H5 Page information , But you can directly follow the original app The way was tested .
I don't know why , If this step is implemented later , And then add
appium The inspector records the script ( quote )
边栏推荐
- 【js】-【节流、防抖函数】
- The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
- asp. Net datalist to display product information and pictures
- 【学习笔记】最短路 +生成树
- Introduction to Devops Basics
- Kubernetes理论基础
- 小艺人黄鑫洋受邀参加巴黎时装周儿童单元武汉站
- 【js】-【DFS、BFS应用】-学习笔记
- Explanation and application of instr() function in Oracle
- MySQL row format parsing
猜你喜欢

LeetCode之三步问题

Doris学习笔记之介绍、编译安装与部署

Redis cerebral fissure

Generation and verification of JWT token

Airflow2.1.1 summary of the pits stepped on in actual combat!!

Vagrant installation

Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally

ROS notes (09) - query and setting of parameters

Design of DSP image data stream

块级元素上下左右居中的两个小技巧
随机推荐
Today's notes 22/1/7
B_QuRT_User_Guide(28)
Activity implicit jump
Eslint syntax monitoring off
【学习笔记】搜索
Disposition Flex
sql主從複制搭建
Doris学习笔记之介绍、编译安装与部署
设置网页的标题部分的图标
B_QuRT_User_Guide(29)
HJ prime factor
Explanation and application of instr() function in Oracle
Flex layout
Conversion between HJ integer and IP address
B_ QuRT_ User_ Guide(28)
图像翻译:UVCGAN: UNET VISION TRANSFORMER CYCLE-CONSISTENT GAN FOR UNPAIRED IMAGE-TO-IMAGE TRANSLATION
nlp序列完全可以模拟人脑智能
redis02——一篇终结redis的五种数据类型操作命令(可学习、复习、面试、收藏备用)
微内核Zephyr获众多厂家支持!
Jenkins' common build trigger and hook services (V)