如何使用 appium 自动化 android 手机后退按钮 [英] How to automate the android phone back button using appium

查看:47
本文介绍了如何使用 appium 自动化 android 手机后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Appium(python 客户端库)对 Android 上的混合移动应用程序进行测试自动化.我一直无法找到任何方法来自动化或创建使用电话后退按钮返回应用程序上一页的手势.有没有可以使用的驱动功能?我尝试使用 self.driver.navigate().back() [希望这会模拟与 Selenium 中相同的行为以导航到上一个 URL] 但无济于事.任何人都可以建议出路吗?

I am working on test automation for a hybrid mobile application on Android using Appium(python client library). I haven't been able to figure out any means to automate or create a gesture for using the Phone back button to go back to the previous page of the app. Is there any driver function that can be used? I tried my luck with self.driver.navigate().back() [hoping this would simulate the same behaviour as in Selenium to navigate to the previous URL] but to no avail. Can anyone suggest a way out?

推荐答案

是的,试试'driver.back()',它模拟了系统的'back'功能.

Yes,try the 'driver.back()', it simulates the system 'back' function.

这篇关于如何使用 appium 自动化 android 手机后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆