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:
Letting Suitest identify the element¶
By clicking at the element using the mouse selection area, Suitest generates a unique identifier.
Identifying with XPath¶
You can identify an element using both absolute and relative XPath.
Identifying with CSS¶
You can identify an element using a CSS expression.
Identifying with attributes¶
You can identify an element using any attribute (e.g. own identifiers defined by application developers).