Selenium AndroidDriver正在等待时秒表计时器未更新
我有一个特定的案例,我必须使用s/o上的某个地方找到的方法暂停我的司机一分钟,以实现有效的预订时间(>60秒),如下所示:Selenium AndroidDriver正在等待时秒表计时器未更新,selenium,selenium-webdriver,appium,Selenium,Selenium Webdriver,Appium,我有一个特定的案例,我必须使用s/o上的某个地方找到的方法暂停我的司机一分钟,以实现有效的预订时间(>60秒),如下所示: return waitf.until(new Function<WebDriver, Boolean>() { public Boolean apply(WebDriver driver) { WebElement timer = null; try { timer
return waitf.until(new Function<WebDriver, Boolean>() {
public Boolean apply(WebDriver driver) {
WebElement timer = null;
try {
timer = driver.findElement(By.xpath(Utils.STOPWATCH_TIMER));
String timerTextString = timer.getText(); // so question
LocalTime localTime = LocalTime.parse(timerTextString, DateTimeFormatter.ofPattern("H:mm:ss"));
if (localTime.isAfter(LocalTime.of(0, 1, 5))) {
return true;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return false;
}
});
返回waitf.until(新函数(){
公共布尔应用(WebDriver驱动程序){
WebElement计时器=null;
试一试{
timer=driver.findElement(By.xpath(Utils.STOPWATCH_timer));
String timerTextString=timer.getText();//所以问题
LocalTime LocalTime=LocalTime.parse(timerTextString,DateTimeFormatter.of模式(“H:mm:ss”);
if(localTime.isAfter(localTime.of(0,1,5))){
返回true;
}
}捕获(例外e){
//TODO自动生成的捕捉块
e、 printStackTrace();
}
返回false;
}
});
现在,问题是变量timerTextString没有更新,因为当我调试值(0:00:00)时,它没有改变整个时间。我的理解是,驱动程序应该每xx毫秒轮询和检查一次,并更新值。在我的应用程序的网络版本上,它起作用了,但在移动应用程序上,我出现了这种情况。我也试着使用隐式等待,但没有帮助我