How to perform mouseover event on browser clickpath synthetic monitor

Summary: Sometimes, a page requires you to hover over or mouse over an element rather than clicking on it. This can be done in Dynatrace Synthetic using a JavaScript event.

Steps to perform a mouseover event in a Browser clickpath

  1. Go to the relevant page in a Chrome browser.

  2. Right-click on the element that you want to interact with on the page-> Inspect the element, which will open the developer tools

  3. Right-click on the element in the Web Developer Tools → Copy → Copy JS path

  4. Paste the JS path in the below element value, and add this JavaScript code into the JavaScript Event of your Browser clickpath monitor.

    function triggerevent(element) 
    {
    var evt = document.createEvent("MouseEvent");
    evt.initMouseEvent("mouseover",true, true);
    element.dispatchEvent(evt);
    }
    
    var element = document.querySelector('button[id="testid"]'); //Replace with the element which you want to perform the mouseover action.
    triggerevent(element);
    

What’s next

Open a chat or contact support if

  • you need to check the logs for an HTTP Monitor running on a public location, or
  • The issue is still not resolved after taking the above actions

What to read next:

HannahM_0-1769097109026.png
  Synthetic Troubleshooting Map

HannahM_0-1769097109026.png
  Synthetic Browser Monitor Error Codes

HannahM_0-1769097109026.png
   Browser monitor JavaScript events

HannahM_0-1769097109026.png
  Configure Browser monitors

HannahM_0-1769097109026.png
  Browser Monitor how-to guides

10 Likes

@Mareeswaran Thank you for sharing this

Thank you so much! This complete the puzzle that i had for synthetic monitoring!!