<?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 add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-add-the-DOM-selector-on-Browser-click-path-monitors-with/ta-p/209499</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the application uses the dynamic iframe then Browser click path monitor events are unable to perform the actions since target window should be modified dynamically based on the iframe number like 'ruxitWin[0].frames[0].frames[0]' or 'ruxitWin[0].frames[0].frames[1]' etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, we can try to use DOM selector and this selector should be used like accessing the required iframe element from parent top element. We can use this method for Shadow DOM applications as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, consider that we have only one iframe element named called "Dynatraceiframe" for the first time navigation &amp;amp; I want to click on the Login button then we have to use the target window 'ruxitWin[0].frames[0]'&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11061iC5F569F3DF21D50D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image1.jpg" alt="image1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image2.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11062i614AE0BE3F53C8D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image2.jpg" alt="image2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;on this case instead of modifying the Target window, we can use the below sample DOM selector on Browser click path monitor events with default Target window,&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;document.querySelector('iframe[name="Dynatraceiframe"]').contentWindow.document.querySelector("#layout-inner &amp;gt; dt-common-navigation").shadowRoot.querySelector("nav &amp;gt; nav &amp;gt; ul &amp;gt; li:nth-child(9) &amp;gt; a")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image3.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11063i6B01688A20D02E16/image-size/large?v=v2&amp;amp;px=999" role="button" title="image3.jpg" alt="image3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image4.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11064i971390C8AD50C7E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image4.jpg" alt="image4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that, we need to set the below chromium startup flags to true on Browser click path script so that we can access the iframe element even both parent document and iframe document domains are different and it can avoid the error Blocked a frame with origin "&lt;A href="https://parentdomain.com" target="_blank"&gt;https://parentdomain.com&lt;/A&gt;" from accessing a cross-origin frame.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;"chromiumStartupFlags": {
"disable-site-isolation-trials":true,
"disable-web-security":true
},&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image6.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11066iFE513B97E2C6DED7/image-size/large?v=v2&amp;amp;px=999" role="button" title="image6.jpg" alt="image6.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image5.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11067i699949A79941A8E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="image5.jpg" alt="image5.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To playback the script on recorder, please follow the below steps,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1. open command window&lt;BR /&gt;2. Go the Chrome installation folder: cd C:\Program Files\Google\Chrome\Application&amp;gt;&lt;BR /&gt;3. Run the command: chrome.exe --disable-site-isolation-trials --disable-web-security --user-data-dir=c:\my-chrome-data\data&lt;BR /&gt;4. Login to your tenant and install the Dynatrace Synthetic Recorder Extension&lt;BR /&gt;5. Once installed, refresh the page and playback click path.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 14:16:47 GMT</pubDate>
    <dc:creator>Mareeswaran</dc:creator>
    <dc:date>2023-04-11T14:16:47Z</dc:date>
    <item>
      <title>How to add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-add-the-DOM-selector-on-Browser-click-path-monitors-with/ta-p/209499</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the application uses the dynamic iframe then Browser click path monitor events are unable to perform the actions since target window should be modified dynamically based on the iframe number like 'ruxitWin[0].frames[0].frames[0]' or 'ruxitWin[0].frames[0].frames[1]' etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a workaround, we can try to use DOM selector and this selector should be used like accessing the required iframe element from parent top element. We can use this method for Shadow DOM applications as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, consider that we have only one iframe element named called "Dynatraceiframe" for the first time navigation &amp;amp; I want to click on the Login button then we have to use the target window 'ruxitWin[0].frames[0]'&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11061iC5F569F3DF21D50D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image1.jpg" alt="image1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image2.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11062i614AE0BE3F53C8D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image2.jpg" alt="image2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;on this case instead of modifying the Target window, we can use the below sample DOM selector on Browser click path monitor events with default Target window,&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;document.querySelector('iframe[name="Dynatraceiframe"]').contentWindow.document.querySelector("#layout-inner &amp;gt; dt-common-navigation").shadowRoot.querySelector("nav &amp;gt; nav &amp;gt; ul &amp;gt; li:nth-child(9) &amp;gt; a")&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image3.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11063i6B01688A20D02E16/image-size/large?v=v2&amp;amp;px=999" role="button" title="image3.jpg" alt="image3.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image4.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11064i971390C8AD50C7E2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image4.jpg" alt="image4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note that, we need to set the below chromium startup flags to true on Browser click path script so that we can access the iframe element even both parent document and iframe document domains are different and it can avoid the error Blocked a frame with origin "&lt;A href="https://parentdomain.com" target="_blank"&gt;https://parentdomain.com&lt;/A&gt;" from accessing a cross-origin frame.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;"chromiumStartupFlags": {
"disable-site-isolation-trials":true,
"disable-web-security":true
},&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image6.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11066iFE513B97E2C6DED7/image-size/large?v=v2&amp;amp;px=999" role="button" title="image6.jpg" alt="image6.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image5.jpg" style="width: 999px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/11067i699949A79941A8E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="image5.jpg" alt="image5.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To playback the script on recorder, please follow the below steps,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;1. open command window&lt;BR /&gt;2. Go the Chrome installation folder: cd C:\Program Files\Google\Chrome\Application&amp;gt;&lt;BR /&gt;3. Run the command: chrome.exe --disable-site-isolation-trials --disable-web-security --user-data-dir=c:\my-chrome-data\data&lt;BR /&gt;4. Login to your tenant and install the Dynatrace Synthetic Recorder Extension&lt;BR /&gt;5. Once installed, refresh the page and playback click path.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 14:16:47 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/How-to-add-the-DOM-selector-on-Browser-click-path-monitors-with/ta-p/209499</guid>
      <dc:creator>Mareeswaran</dc:creator>
      <dc:date>2023-04-11T14:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to add the DOM selector on Browser click path monitors with the Dynamic iframes scenarios</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/How-to-add-the-DOM-selector-on-Browser-click-path-monitors-with/tac-p/212105#M194</link>
      <description>&lt;P&gt;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40562"&gt;@Mareeswaran&lt;/a&gt;&amp;nbsp;thank you for sharing this!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 19:07:06 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/How-to-add-the-DOM-selector-on-Browser-click-path-monitors-with/tac-p/212105#M194</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-05-12T19:07:06Z</dc:date>
    </item>
  </channel>
</rss>

