Interrogation of a single-page application
A single-page application (SPA) is a web application that dynamically rewrites a web page in response to some user action, rather than the browser's standard method of loading a new page or refreshing. This approach makes the SPA behave more like a desktop application. All the HTML, CSS, and JavaScript code loads at one time and data is retrievable from the server as needed. The location hash or the HTML5 History API can provide the perception of separate logical pages in the application. Many modern websites, such as Trello, Facebook, Twitter, and Gmail, are single-page applications.
In a SPA, all of the Document Object Model (DOM) elements exist on one page, which creates an environment that differs from a traditional web application. These differences can lead to performance issues and complicated match rules to uniquely identify controls.
Pega Robot Studio includes defining a logical hierarchical structure for these applications, which reduces matching time and simplifies match rules to make it easier to develop automations for SPAs.
Containers
When interrogating a SPA, you define controls to use container controls and create a logical view of the web application. To create a container during the interrogation, use the Select Element mode. You can also create a container from the Palette after interrogating and matching the control.
For more information about container controls, see: Container controls.
Containers also make creating automations with SPAs easier. When automating web applications, you often use the WaitForCreate method of a page to determine the control’s availability before you automate the control. In a SPA, the page does not change or refresh. Without containers, you would have to call WaitForCreate for each control, but with containers properly configured, you can call the WaitForCreate method on the parent container.
Check your knowledge with the following interaction:
This Topic is available in the following Modules:
Want to help us improve this content?