答案 0 :(得分:0)
你需要找到那个加载器并放置ExplicitWait
直到它变得不可见,然后对其他元素执行操作
WebElement loader = driver.findElement(By.id("loader_id"));
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.invisibilityOf(loader));
答案 1 :(得分:0)
您需要检查是否在页面上加载了javaScripts,因为您需要在这样的脚本中使用javascript命令
JavascriptExecutor js =(JavascriptExecutor)driver;
boolean loadProcess=(Long)js.executeScript("return jQuery.active") == 0;
while((loadProcess==false)){
try {
Thread.sleep(2000);
loadProcess=(Long)js.executeScript("return jQuery.active") == 0;
logger.info("loadProcess : "+loadProcess);
} catch (InterruptedException e) {
logger.info("waitForJStoLoad error "+e.getMessage());
} }