Information:

Environment

  • Dynatrace Recorder
  • Firefox Agent
  • Scripting

 

Symptoms

Can the Dynatrace Recorder record a right-click action? I need to execute the right-click operation in a transaction.

Solution

The Dynatrace Recorder does not have a right-click action. You can, however, use JavaScript in a Custom action to support this feature in the Firefox Agent.

Use this sample code in a Custom action:

var evt = document.createEvent('MouseEvents');
evt.initMouseEvent('contextmenu', true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 2, null);

document.getElementById('P77676_TOPX_R1').dispatchEvent(evt);

Also see Right-Clicking on an Element in the documentation.