2015-09-07 85 views

回答

1

到目前为止,如果您正在使用更新版本的Java客户端for appium(版本3.2.0),则无法回家。 可以使用保持应用程序在后台尽管对于所需的时间量: driver.runAppInBackground(120); //where time:120 is in seconds

0

我觉得你的代码是正确的driver.sendKeyEvent(AndroidKeyCode.HOME);必须工作,你可以尝试后driver.launchAPP();方法给予一定的超时,因为它可能尝试打印线和导航在应用程序启动之前回到家

使用Thread.sleep(5000); driver.launchAPP();之后让我知道它是否有效。

1
driver.findElementByClassName("android.widget.ImageButton").click(); 
    WebDriverWait wait = new WebDriverWait(driver, 1000); 
    wait.until(new Predicate<WebDriver>() { 
     @Override 
     public boolean apply(WebDriver input) { 
      return input.findElement(By.name("Login")) != null; 

     } 
    }); 
    driver.navigate().back(); 
相关问题