appium - 如何打开和关闭应用程序并仍然记录每个测试用例?(RobotFramework/AppiumLibrary)
问题描述
我正在尝试使用 AppiumLibrary 设置机器人框架自动化。我想关闭应用程序并在每个测试用例中再次打开它,但无需再次登录。实际上,当我关闭应用程序时,应用程序会重置并要求我再次登录。我只是将“noReset=true”功能放在 Open Application 上,但这并不能解决我的问题。有人知道该怎么做吗?
***Settings***
Library AppiumLibrary
***Keywords***
Start Session
Set Appium Timeout 10
Open Application http://localhost:4723/wd/hub
... automationName=UiAutomator2
... platformName=Android
... deviceName=emulator-5554
... appPackage=br.com.app.app
... appActivity=.MainActivity
... autoGrantPermissions=true
... noReset=true
Sleep 5
Start app
Wait Until Page Contains Hello
Close Session
Capture Page Screenshot
Close Application noReset=true
Close Application
Capture Page Screenshot
Quit Application
Launch Application
Open Application http://localhost:4723/wd/hub
... automationName=UiAutomator2
... platformName=Android
... deviceName=emulator-5554
... appPackage=br.com.app.app
... appActivity=.MainActivity
... autoGrantPermissions=true
... noReset=true
***Test Cases***
See the first screen
[Setup] Start Session
Start app
Log in
Check the first screen
[Teardown] Close Application
See the second screen
[Setup] Launch Application
Check the first screen
[Teardown] Close Session
解决方案
尝试在功能中同时使用 fullReset=false 和 noReset=true。这可以解决您的问题。
推荐阅读
- node.js - 当 firebase-admin 写入数据时,使用规则验证 Firebase
- ios - 请求用户名时,Firebase 快照返回 null
- html - 搜索文本隐藏文本输入 html 中的搜索图标
- html - 连续对齐 3 个部分标签
- node.js - 带有自定义验证的招摇
- haskell - 为什么 Complex 的乘法实现需要 RealFloat?
- java - Android-在获取值的方法/侦听器之外使用变量值
- reactjs - 在 xxx.heroku.com 找不到开放端口
- linux - 设备树编译器无法识别包含文件的 C 语法
- pointers - 在golang中返回一个指针