<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article How to perform a keypress in a Browser Clickpath Synthetic Monitor in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-perform-a-keypress-in-a-Browser-Clickpath-Synthetic/ta-p/237412</link>
    <description>&lt;H2&gt;Summary&lt;/H2&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;
&lt;DIV&gt;Browser Clickpath Synthetic Monitors in Dynatrace validate end-user journeys by recording clicks and keystrokes. However, some web applications depend on keyboard inputs (such as Enter, Escape, arrow keys, or function keys) that the Dynatrace Synthetic Recorder doesn’t capture.&lt;BR /&gt;This article explains how to simulate keypress actions in a Browser Clickpath Synthetic Monitor using JavaScript synthetic events, enabling reliable monitoring of applications that rely on keyboard input.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="3"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;
&lt;H2&gt;Problem&lt;/H2&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;The Dynatrace Synthetic Recorder doesn't capture keyboard‑only interactions such as:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Pressing Enter or Escape&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Navigating menus with arrow keys&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Triggering actions with function keys&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;
&lt;DIV&gt;As a result, Browser Clickpath Synthetic Monitors may fail or behave unexpectedly when replaying user journeys that require these keypresses, even though the application works correctly for real users.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;H2&gt;Troubleshooting steps&lt;/H2&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;
&lt;DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;Before implementing a solution, confirm the following:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;The failing step in the Browser Clickpath Monitor requires a keyboard action rather than a mouse click.&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;The keypress is:
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Global (not tied to a specific element), or&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Associated with a specific input or UI element.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;You know the key code for the required keypress (for example, Enter, Escape, F-keys, arrow keys).&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;If these conditions are true, handle the interaction using a JavaScript synthetic event instead of a recorded step.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H2&gt;Resolution&lt;/H2&gt;
&lt;DIV&gt;
&lt;DIV&gt;To perform a keypress in a Browser Clickpath Synthetic Monitor, add a JavaScript event that dispatches keyboard events manually:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;STRONG&gt;Identify the key code&lt;/STRONG&gt; for the required keyboard action.&lt;BR /&gt;Example: For F7, the code is 118. Find key codes &lt;A class="fui-Link ___w5et180 f2hkw1w f3rmtva f1ewtqcl fyind8e f1k6fduh f1w7gpdv f1mo0ibp fjoy568 ff5ikls f1s184ao f1mk8lai fnbmjn9 f1o700av f13mvf36 f1cmlufx f9n3di6 f1ids18y f1tx3yz7 f1deo86v f1eh06m1 f1iescvh fhgqx19 f1olyrje f1p93eir f1nev41a" tabindex="0" href="https://www.oreilly.com/library/view/javascript-dhtml/9780596514082/apb.html" target="_blank" rel="noopener noreferrer" data-tabster="{&amp;quot;restorer&amp;quot;:{&amp;quot;type&amp;quot;:1}}"&gt;here&lt;/A&gt;.&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;Determine the target element&lt;/STRONG&gt;:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;STRONG&gt;Page body&lt;/STRONG&gt;: If the keypress isn’t tied to an element, use &lt;CODE&gt;body&lt;/CODE&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;var input = document.querySelector("body");​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;STRONG&gt;Specific DOM element&lt;/STRONG&gt;:
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Open the page in Chrome.&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Right-click the target element → &lt;STRONG&gt;Inspect&lt;/STRONG&gt;.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HannahM_3-1708342198080.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17665iAC499758BFEFE3DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HannahM_3-1708342198080.png" alt="HannahM_3-1708342198080.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;In Developer Tools, right-click the element → &lt;STRONG&gt;Copy &amp;gt; Copy JS path&lt;/STRONG&gt;.&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CopyJSPath.png" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/17667iA9220A515F5BDB8E/image-size/large?v=v2&amp;amp;px=999" role="button" title="CopyJSPath.png" alt="CopyJSPath.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Use that selector in your script&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;var input = document.querySelector("#yourSelector");​&lt;/LI-CODE&gt;
&lt;DIV id="tinyMceEditorMareeswaran_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;DIV id="tinyMceEditorMareeswaran_3" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Update the JavaScript snippet&lt;/STRONG&gt; with:
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;key&lt;/STRONG&gt;: The key to press&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;keyCode&lt;/STRONG&gt;: The corresponding key code&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;input&lt;/STRONG&gt;: Either &lt;CODE&gt;"body"&lt;/CODE&gt; or the selector&lt;BR /&gt;Example:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;var parameters1 = {isTrusted: true, altKey: false, bubbles: true, cancelBubble: false, cancelable: true, charCode: 0, code: "F7", composed: true, ctrlKey: false, defaultPrevented: true, detail: 0, eventPhase: 0, isComposing: false, key: "F7", keyCode: 118, location: 0, metaKey: false, repeat: false, returnValue: false, shiftKey: false, which: 118};

var parameters2 = { isTrusted: true, altKey: false, bubbles: true, cancelBubble: false, cancelable: true, charCode: 0, code: "F7", composed: true, ctrlKey: false, defaultPrevented: false, detail: 0, eventPhase: 0, isComposing: false, key: "F7", keyCode: 118, location: 0, metaKey: false, repeat: false, returnValue: true, shiftKey: false, which: 118};

var input = document.querySelector("#yourSelector");
input.dispatchEvent(new KeyboardEvent("keydown", parameters1));
input.dispatchEvent(new KeyboardEvent("keyup", parameters2));​​&lt;/LI-CODE&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;STRONG&gt;Add this script as a&lt;A href="https://docs.dynatrace.com/docs/platform-modules/digital-experience/synthetic-monitoring/browser-monitors/configure-browser-monitors#recorded-clickpath" target="_self"&gt; JavaScript step&lt;/A&gt;&lt;/STRONG&gt; in your Browser Clickpath Synthetic Monitor and position it in the sequence as needed.&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 id="toc-hId--526228148"&gt;What's Next&lt;/H2&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV class="paragraph-in-scc-markdown-text ___1ngh792 ftgm304 f1iaxwol"&gt;If the keypress alone doesn't resolve the issue:&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Verify if additional events (like focus or input) are required.&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;For advanced interaction scenarios, check the guidance on JavaScript events in Browser Clickpath Monitors.&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;If problems persist, open a support chat and provide:
&lt;UL&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;A link to the affected monitor&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Details of the simulated keypress&lt;/LI&gt;
&lt;LI class="___ccc16d0 fje8fi8 f1ng9h0j f1bwykku f18jd3zf"&gt;Any JavaScript used&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;H3&gt;&lt;BR /&gt;Related reading&lt;/H3&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":open_book:"&gt;📖&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;A class="" href="https://community.dynatrace.com/t5/Troubleshooting/Synthetic-Troubleshooting-Map/ta-p/250426" target="_blank" rel="noopener"&gt;Synthetic Troubleshooting Map&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":open_book:"&gt;📖&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/browser-monitors/configure-browser-monitors" target="_blank" rel="noopener noreferrer"&gt;Configure Browser Monitors&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":open_book:"&gt;📖&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.dynatrace.com/docs/observe/digital-experience/synthetic-monitoring/browser-monitors/browser-clickpath-events#javascript" target="_blank" rel="noopener noreferrer"&gt;Browser Monitor JavaScript events&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2026 12:35:57 GMT</pubDate>
    <dc:creator>HannahM</dc:creator>
    <dc:date>2026-04-27T12:35:57Z</dc:date>
    <item>
      <title>How to perform a keypress in a Browser Clickpath Synthetic Monitor</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-perform-a-keypress-in-a-Browser-Clickpath-Synthetic/ta-p/237412</link>
      <description>&lt;P&gt;&lt;LI-TOC indent="15" liststyle="disc" maxheadinglevel="2"&gt;&lt;/LI-TOC&gt;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P&gt;*&lt;EM&gt;Use a table of contents for longer articles.&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;H1&gt;Summary&lt;/H1&gt;
&lt;P&gt;&lt;EM&gt;*This is a mandatory section.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Short description of which part of the Dynatrace platform the article refers to and what kind of problem it will help resolve / task it will describe.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Problem&lt;/H1&gt;
&lt;P&gt;&lt;EM&gt;*This is a mandatory section.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Provide a precise description of the problem / task to be described.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Troubleshooting steps&lt;/H1&gt;
&lt;P&gt;&lt;EM&gt;*This section can be omitted.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;Resolution&lt;/H1&gt;
&lt;P&gt;&lt;EM&gt;*This section can be omitted for ticket‑creation articles.&lt;/EM&gt;&lt;/P&gt;
&lt;H1&gt;What's next&lt;/H1&gt;
&lt;P&gt;&lt;EM&gt;*This is a mandatory section.&lt;/EM&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 Apr 2026 12:35:57 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/How-to-perform-a-keypress-in-a-Browser-Clickpath-Synthetic/ta-p/237412</guid>
      <dc:creator>HannahM</dc:creator>
      <dc:date>2026-04-27T12:35:57Z</dc:date>
    </item>
  </channel>
</rss>

