Identifying elements when testing Lightning JS applications

When testing applications build with Lightning JS framework, the Lightning inspector needs to be enabled. Once the application is opened on a device, the framework generates unique identifiers for all elements. Unfortunately, these identifiers differ with each execution. Luckily, Suitest provides several ways to identify elements when testing Lightning JS applications.


Below, you can find examples using different identifier options in Suitest. For these examples, we use the WatchMe application built with the Lightning JS framework, identifying the following element:

Identified element

Letting Suitest identify the element

By clicking at the element using the mouse selection area, Suitest generates a unique identifier.

Element identification by Suitest

Identifying with XPath

You can identify an element using both absolute and relative XPath.

Absolute XPath example
Relative XPath example

Identifying with CSS

You can identify an element using a CSS expression.

Element identification using CSS

Identifying with attributes

You can identify an element using any attribute (e.g. own identifiers defined by application developers).

Element identification using attributes