public static void confirmOkButton(WebDriver driver) {

   WebElement elements = driver.findElement(By.xpath("//button[contains(text(),'OK')]"));

   ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", elements);
  ((JavascriptExecutor) driver).executeScript("arguments[0].click();", elements);

   new WebDriverWait(driver, Long.parseLong(ReadFromProperty.getProperty("PAGE_ELEMENT_TIMEOUT"))).until(ExpectedConditions.invisibilityOfElementLocated(By.className("bx--btn--primary")));

}

 posted on 2021-05-18 15:45  zennpumpkin  阅读(34)  评论(0编辑  收藏  举报