Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //метод ожидания
- protected void waitForVisibilityOf(By locator, Integer... timeOutInSeconds){
- int attempts =0;
- while (attempts <2){
- try {
- waitFor(ExpectedConditions.visibilityOfElementLocated(locator), (timeOutInSeconds.length >0 ? timeOutInSeconds[0]: null));
- break;
- } catch (StaleElementReferenceException e) {
- }
- attempts ++;
- }
- }
- private void waitFor(ExpectedCondition<WebElement> condition, Integer timeOutInSeconds){
- timeOutInSeconds = timeOutInSeconds != null ? timeOutInSeconds :30;
- WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds);
- wait.until(condition);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement