- wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement()));
- certificatePopUp.clickOnOkButton();
+ //sometimes the certificate has been already accept and it doesn't appear again
+ try {
+ wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement()));
+ //we need to repaint the screen because of some element are misplaced
+ driver.rotate(ScreenOrientation.LANDSCAPE);
+ driver.rotate(ScreenOrientation.PORTRAIT);
+ certificatePopUp.clickOnOkButton();
+ }catch (NoSuchElementException e) {
+
+ }
+