[英]How to automate the android phone back button using appium on emulator
I have recently started working on test automation for a native mobile application on Android using Appium(java client library). 我最近开始使用Appium(java客户端库)为Android上的本机移动应用程序进行测试自动化。 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 following code, 我尝试了以下代码,
driver.sendKeyEvent(AndroidKeyCode.BACK);
by checking other posts, but it did not work for me. 通过检查其他帖子,但对我不起作用。 Can anyone suggest a solution? 谁能提出解决方案?
您需要使用以下代码返回。
driver.pressKeyCode(AndroidKeyCode.BACK);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.