Generating Page Object Model (POM)
Applitools TestGenAI for Cypress can create a page object class containing the elements of a page. The Page Object Model (POM) is an industry-best-practice design pattern for software test automation. It organizes test code by creating a separate class for each component of the application being tested. This class contains methods to interact with the page elements, such as entering text or clicking buttons. This reduces code duplication and helps make tests more efficient, maintainable, and readable.
To Generate a POM:
-
In Chrome, navigate to a page you want to generate a POM.
-
Open the TestGenAI extension.
-
Click Generate POM.
TestGenAI generates a list of all interactable elements in the browser's viewport.
By default, the POM generator captures only interactable elements within the browser's viewport. If you need to capture elements on longer scrollable pages, scroll to the region and click Generate POM again.