ATSF - Automation Testing Selenium Framework developed in CTCo for:
Components
The problem with WebElement interface:
Using plain WebElement interface
The solution
Decorator Pattern
ATSF currently supported custom web element classes:
Overriding default ATSF implementation
NOTE -
Every decorator extends UIElementImpl class, which in turn is the base class for manipulating with web elements and have all base methods
Waiting for Progress Bar to Dissapear
Always use explicit wait. Forget that implicit wait exists.
Explicit wait:
documented and defined behaviour.
runs in the local part of selenium (in the language of your code).
works on any condition you can think of.
returns either success or timeout error.
can define absence of element as success condition.
can customize delay between retries and exceptions to ignore
undocumented and practically undefined behaviour.
runs in the remote part of selenium (the part controlling the browser).
only works on find element(s) methods.
returns either element found or (after timeout) not found.
if checking for absence of element must always wait until timeout.
cannot be customized other than global timeout.
Therefore, implicit waiting was removed from ATSF framework and now uses only explicit waiting
The problem:
NoSuchElementException and
TimeoutException
public ControlPeriodModel(WebDriver driver) {
super(driver);
WebDriverWait webDriverWait = new WebDriverWait(driver, 5000);
webDriverWait.until(ExpectedConditions.visibilityOf(getLblStatus().getElement()));
}
public ControlPeriodModel(WebDriver driver) {
super(driver);
this.getLblStatus().waitForElementToBeDisplayed(WAIT_EXPLICIT);
}
Now
Previously
Added more explicit waiting methods
ATSF Framework