Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Explicit Waits

Mariusz Kubiś edited this page Jul 14, 2016 · 4 revisions

Explicit Waits

Selenium reference: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-waits

BobcatWait is enhanced version of WebDriverWait which is responsible for pausing the test until given condition is fulfilled. To use BobcatWait just inject it into your class.

@Inject
private BobcatWait wait;

Bobcat ExpectedConditions

UrlExpectedConditions

Class contains expected conditions for URL, e.g.

wait.withTimeout(10).until(UrlExpectedConditions.pageUrlContains("/home"));

CommonExpectedConditions

Class contains custom conditions for WebElements, e.g.

wait.withTimeout(10).until(CommonExpectedConditions.elementHasAttributeWithValue(menu, "class", "visible"));

JcrExpectedConditions

Class contains expected conditions for JCR, e.g.

  @Inject
  private JcrAuthorUtils provider;
  //..
  bobcatWait.withTimeout(10).until(JcrExpectedConditions.nodeExist(provider.getSession(), "/content"));

How to write own Expected Condition

  @Inject
  private WebDriver webDriver;

  @Inject
  private BobcatWait bobcatWait;
  //..
    bobcatWait.withTimeout(Timeouts.BIG).until(driver -> {
      WebElement button = driver.findElement(By.className("my-button-class"));
      return button.isEnabled();
    }, 2);

Getting started with Bobcat

  1. Getting started

AEM Related Features

  1. Authoring tutorial - Classic
  1. AEM Classic Authoring Advanced usage
  1. Authoring tutorial - Touch UI
Clone this wiki locally