当前位置:网站首页>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 )
边栏推荐
- SQL Master slave Replication Build
- [shangpinhui] project notes
- NLP sequence can completely simulate human brain intelligence
- Explanation and application of instr() function in Oracle
- Is it reliable for the top ten securities companies to register and open accounts? Is it safe?
- Ambari (VIII) --- ambari integrated impala document (valid for personal test)
- ROS notes (08) - definition and use of service data
- asp. Net registration page
- Redis cluster deployment and application scenarios
- 22/02/14 study notes
猜你喜欢
设置网页的标题部分的图标
ZYNQ_ IIC read / write m24m01 record board status
新唐NUC980使用记录:自制开发板(基于NUC980DK61YC)
MySQL installation and environment variable configuration
探讨gis三维系统在矿山行业中的应用
Cloud native: cloud computing technology is upgraded again to open an era of comprehensive cloud development
抗洪救灾,共克时艰,城联优品捐赠10万元爱心物资驰援英德
sql分析(查询截取分析做sql优化)
SOC timer and interrupt configuration
kubernetes集群命令行工具kubectl
随机推荐
Activity隐式跳转
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
Redis cerebral fissure
Is it reliable to open a new bond registration account? Is it safe?
【js】-【节流、防抖函数】
Introduction to kubernetes (I)
asp. Net datalist to display product information and pictures
The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
券商注册开户靠谱吗?安全吗?
Generation and verification of JWT token
开户券商怎么选择?网上开户是否安全么?
Ambari (IX) --- use expect to realize no interaction in ambri server setup phase (valid for personal test)
Host is not allowed to connect to this MySQL server
Flex layout
Redis cluster deployment and application scenarios
22/02/15 study notes
B_QuRT_User_Guide(26)
Airflow2.1.1 summary of the pits stepped on in actual combat!!
B_QuRT_User_Guide(29)
Study notes 22/1/11