Automation Code that self-maintains - How to effectively reduce test maintenence with intelligent Page Objects that use Multiple Locators

This requires use of the UI Scanner. Download it: ______________________________________________

Avoiding brittle Page Identifiers that cause Test Scripts to fail: As with traditional Page Objects, there’s one Element Identifier ie, an XPath per Object in a typical Application. Therefore a changed Object in the Application causes a Test Script to fail. So here we can use a technique to avoid shore-up the brittle nature of Page Identifiers.

Benefit: Test Modeller apply multiple Locators per Element.

What’s to know? They go beyond one-to-one mapping. Therefore as Automation gets executed the framework learns and dynamically updates the Locators.

Part 1: Scan and upload Page Objects

Part 2: In Test Modeller locate the recently uploaded Page Object. To do so click Models (Explorer in the updated UI) from the sidebar. Swivel open the Object and see the Parameters of a multitude of the XPath and Tag name Locators. This moves away from the one-to-one mappping to multiple Identifiers.

Part 3: Create some Tests by Overlaying the functions from the Page Objects. To do so first in Models (Explorer in the updated UI) click New Model > on the Canvas drag a Start node > with Start node selected in the Automation pane navgate the directory to locate one of the modules from the Page Objects.

Part 4: With a flow created go in and Generate some Tests. To do so, go to the top Ribbon menu > click the Test Generation tab > choose and click the Generate (plane) icon > in the Test Cases (Scenarios in the updated UI) pane. Click the Run (arrow) button and Execute it.

See how Test Modeller can handle changes to an Automation sctipt:

Part 5: In the download Java framework script see the Classes embedded | the Log-in Page Objects | Test Definition going throught the Scenarios Generated in test Modeller.

Part 6: In the Defintions file of the Webapge being tested make some changes to the Id's, possible reorder them. Run the Script and it passes.

Part 7: In the Notifications panel of test Modeller > see that 2 of the Page Objects were Auto-magically (sic) updated. To verify open the Page Object > see a Magic wand icon saying that the Identifier reflects it’s been updated with the latest changed Identifier related to the underlying Application).