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

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

At times, some page elements can't be located due to network issues or loading issues. There are two methods of fixing the error: you can either check the root cause analysis (RCA) screenshot or you can edit the web script.


To fix the error by editing the web script:

  1. Log in to Site24x7.

  2. Navigate to Home > Monitors.

  3. Click the monitor of your preference.

  4. On the Monitor Status page that opens, click the hamburger icon next to the monitor name and click Edit Web Script.

  5. In the script that opens, add lines in the following format with appropriate values above the page elements that are unable to be located:

          
         

Quote

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, this is the format:
     

Quote  wait("1000")
  wait_for_element_presence("xpath",".nav__inner .site-nav__spacer__top-handheld","40")
  wait_for_element_visibility("xpath",".nav__inner .site-nav__spacer__top-handheld","40")


          
Edit web script

    • Related Articles

    • How to configure the NGINX status page for monitoring NGINX performance

      The NGINX plugin uses the NGINX status page to pull the performance metrics of the NGINX server. You may encounter the following errors while installing the NGINX plugin integration: Error_code : HTTP Error 404: This error usually indicates that the ...
    • API exceeded error

      Why do I get an API exceeded error after a few attempts? Every API has a certain limit to the number of requests a user can hit within a period of time, called the rate limit. An error message is triggered when a user does one of the following ...
    • Troubleshoot the Error 404 and Error 99 for RabbitMQ

      When installing the RabbitMQ plugin, you may encounter the following errors: HTTP Error 404: Not Found: This error usually occurs when Site24x7's RabbitMQ monitoring plugin attempts to access the /api/overview page of RabbitMQ, but the resource ...
    • Troubleshoot "[Errno 111] Connection refused" error for RabbitMQ plugins

      When installing the RabbitMQ plugin, you may encounter the following error: urlopen error [Errno 111] Connection refused: This error usually occurs when the plugin tries to connect with the RabbitMQ server but is unable to establish a connection. ...
    • Troubleshoot the Unauthorized user (Error 401) when installing Tomcat plugins

      When installing Tomcat plugins, you may encounter the following error: Unauthorized user. Does not have permissions. HTTP Error 401: This error usually occurs when the user accessing the Tomcat Manager application does not have the necessary ...