In one test cases I used this
@Test
public void Test1()
{
driver.launchApp();
System.out.println("this is First test in appium suite");
((AppiumDriver) driver).sendKeyEvent(AndroidKeyCode.HOME); // This line of code gives error.
}
最佳答案
到目前为止,如果您使用的是 appium 的 java 客户端更新版本(版本 3.2.0),则无法返回主页。
您可以使用以下命令将应用程序保留在后台所需的时间:
driver.runAppInBackground(120);//其中time:120以秒为单位
关于java - 在自动化 Android 应用程序时,如何通过单击 appium 中的主页按钮导航到主屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32436467/