RBM - What should I do if I get the error "Unable to locate an element on a page"?

RBM - What should I do if I get the error "Unable to locate an element on a page"?


If there is a network or a loading issue, page elements cannot be located. In such cases, you can refer to the screenshot for page load status. If the page is loaded, you can edit the web script.

Warning
Unnecessary space or characters in the playback script will lead to script syntax errors. Please edit with caution.

To fix the error by editing the script:

1. Go to RBM Monitor details page -> Monitor Actions -> Edit playback script
2. In the script, add the lines in the following format with appropriate values, above the page elements that cannot be located.
Info
wait(<time in milliseconds>)
wait_for_element_presence(<element type>,<element name>,<maximum wait time in seconds>)
wait_for_element_visibility(<element type>,<element name>,<maximum wait time in seconds>)

For example, in the case of an Xpath element, the format is given below:

Info
wait("1000")
wait_for_element_presence("xpath","element_xpath","40")
wait_for_element_visibility("xpath","element_xpath","40")

Similarly, you can add the other element types like id, name, and css as well.
Notes
Maximum of 40s can be given for wait time

Warning
These methods are only supported in EUM Agent versions 21.3 and above. 
Sample Script:



Notes
By default, Applications Manager will check for the element presence with 10s as the timeout. Adding these dynamic waits will add an additional timeout to the default timeout.

Option to increase element timeout for the entire script: 

To increase the element timeout globally for all the elements, you can use the line given below at the top of the playback script.
Info
set_element_timeout("<maximum wait time in seconds>")
Example:
Info
set_element_timeout("40")
Sample Script:



Notes
The default element timeout is 10s. Maximum timeout of 40s can be given using this method.

                  New to ADSelfService Plus?

                    • Related Articles

                    • RBM - Steps to perform Test Playback

                      What is Test Playback? Applications Manager's Real Browser Monitor works based on a playback script that is created during the monitor creation or recording of the transactions. This playback script will contain Locators to locate the HTML elements ...
                    • RBM - Configure Element Based Content Check using Playback Script

                      Element based Content Check option Applications Manager's Real Browser Monitoring allows to configure content check for a particular element in the webpages. One can configure checks for both Content to be present and Content not to be present for ...
                    • RBM - FAQs

                      1. I am unable to create a new RBM monitor. Go to the Settings -> Support tab in Applications Manager and check the license Information. Verify if "EUM Add-on" option is enabled. If it is not enabled, contact sales@manageengine.com to purchase/trial ...
                    • RBM - Enabling the Playback using Microsoft Edge browser

                      Note: Please note that playback using the Microsoft Edge browser is possible only in a Windows server with Microsoft Edge installed on it Please find the below steps to enable the Playback using Microsoft Edge in an EUM Agent: Download the compatible ...
                    • RBM - Configure Content Check using Playback Script

                      Content Check option Applications Manager's Real Browser Monitoring allows to configure content check to be done on the webpages in between the steps. One can configure checks for both Content to be present and Content not to be present. Syntax of ...