Get Started
UI Test Automation Model (UTAM) makes it easier to write end-to-end UI tests by abstracting page object code into JSON. Page objects encapsulate UI components into a scalable interface for your test code. The UTAM framework is a web standard, and can test non-Salesforce apps, too.
Other writing query selectors for end-to-end tests don't scale because when the DOM structure changes, query selectors break. A large application can have a lot of query selectors, which means a lot of time fixing tests. But page objects encapsulate the capabilities of a UI component into an interface that test code can interact with. Each application component has a corresponding JSON page object that declares its test interface. UTAM provides a JSON grammar to write page objects and a compiler to generate runnable code in Java or JavaScript. The runnable test code UTAM creates expects certain things in the UI (like clearing or setting text). UTAM abstracts the DOM away from the test, insulating test expectations from implementation details like shadow DOM.
To get started with UTAM, choose the resources that match your learning style.
- UTAM Tutorials for a suite of interactive tutorials.
- JSON page object grammar
- Salesforce Developers' Blog: Run End-to-End Tests with UTAM
The utam-js-recipes and utam-java-recipes repos contain examples of how to test the Salesforce UI.
- Browser extension to help you find page objects provided by Salesforce
- UTAM Generator to generate UTAM JSON page objects from HTML files
- Design Page Objects if you prefer to manually build JSON page objects from scratch instead of using the UTAM generator
- Compile your JSON page objects to JavaScript or Java page objects
- Write tests for JavaScript or Java