Skip to main content

Script Examples

Locating elements

By using CSS selector

UIElement element = E(byCssSelector("your.Id"));

By using ID

UIElement element = E(byId("your.Id"));

By using xPath

UIElement element = E(byXpath("//some"));

It is possible to use all strategies by switching back and forth.

public void testUIWithLoadero() {
// Example of locating elements using CSS selector

// Wait 10 seconds until page is visible

// Save a screenshot of website

// Find search bar element

// Type "QA Processes" in it
.sendKeys("QA Processes")

// Find search button and click it

// Wait for search results to become visible
.setElement(byCssSelector("[aria-label='Search Results']")).waitFor(10).untilIsVisible()

// Take a screenshot of the search results

Using TestUI Element Assertion methods


You can find detailed descriptions and more examples in TestUI wiki