Identification of dynamic window titles

During a Web UI test playback, it is difficult to identify dynamic titles in multiple windows. The titles can change dynamically based on factors such as date, time, or other variables. To address these dynamic changes, you can use the regular expressions in HCL OneTest UI.

During a Web UI test recording, there can be scenarios where a report or information is displayed in a new window. The title of this window can contain dynamic information such as the current date and time. In such cases, you can edit the recorded test and use regular expressions in the title field of the Window node that matches the pattern of the dynamic title of the window.

Consider the following example.

During a Web UI test recording of an application under test (AUT), a report was displayed in a new window, and the new window (report) displayed the following title.

Window title: Order_2023May19T143000_[AzHrlo]

In this scenario, the report title contains dynamic data that includes alphanumeric characters, underscores, and brackets, which changes every time the report is generated when you play back the test. For HCL OneTest UI to identify this dynamic title during the playback, you can use the following regular expressions in the In Window Details panel of the corresponding Window node in the test.

Regular expressions used in the Window title: Order[\\[a-zA-Z_0-9\\]]*

Image of the In Windows Details panel

By using regular expressions for the title of dynamic windows, HCL OneTest UI can identify and locate the window during the test playback. The regular expressions act as dynamic patterns that match the changing elements within the title. Therefore, HCL OneTest UI can accurately identify multiple windows, even when there are changes in the title.