<?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>topic Re: Report testing Automation (using Playwright) - unable to click button in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372457#M25719</link>
    <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/234736"&gt;@wadezone&lt;/a&gt;&amp;nbsp;Have you seen this article?&amp;nbsp;&lt;A href="https://powerpivotpro.com/2018/09/automated-testing-using-dax-for-power-bi/" target="_blank"&gt;https://powerpivotpro.com/2018/09/automated-testing-using-dax-for-power-bi/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 15:05:03 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-09-15T15:05:03Z</dc:date>
    <item>
      <title>Report testing Automation (using Playwright) - unable to click button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372438#M25718</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp;&lt;/SPAN&gt;have been asked to figure out report automation testing for our analtyic reports on our internal company site.&lt;BR /&gt;The reports are done in Power BI.&lt;BR /&gt;I need to be able to search for something, drill through, get a value on the report and check it against a database.&lt;BR /&gt;I haven't been able to find where others are doing something like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the selenium IDE and recorder, Cypress, and Playwright.&lt;BR /&gt;I am having the most success with Playwright but continue to hit some road blocks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a search button and a clear button on the report. I can 't get Playwright to click on either one of the buttons.&lt;/P&gt;&lt;P&gt;I have tried from the "page" and from the "frame" objects the different possible methods/events with no luck.&lt;BR /&gt;I am succesful in finding the frame with the following lines of code&lt;/P&gt;&lt;PRE&gt;const frame = page.frames().find(frame =&amp;gt; frame.name() === 'visual-sandbox');
console.log(frame.name());&lt;/PRE&gt;&lt;P&gt;After typing in the search button the value to search, I tried to do a "enter" which should also trigger the search button.&lt;BR /&gt;&lt;BR /&gt;I have tried so many things that I didn't keep a running list.&lt;/P&gt;&lt;P&gt;Examples below, I tried doing the same from the "await frame ...."&lt;/P&gt;&lt;PRE&gt;await page.click('//button[normalize-space(.)="Cear"]');
await page.dispatchEvent('button#c-glyph.search-button', 'click');
await page.click('search-button');
await page.press('#sandbox-host &amp;gt; div', "Enter");


const [response] = await Promise.all([
page.waitForNavigation(), // The navigation promise resolves after navigation has finished
page.click('#sandbox-host &amp;gt; div &amp;gt; button.c-glyph.search-button'),
//]);&lt;/PRE&gt;&lt;P&gt;I got the furthest with the following line where it looks like it knew what I was asking.&lt;BR /&gt;const hrefElement = await frame.$('#sandbox-host &amp;gt; div &amp;gt; button.c-glyph.search-button');&lt;BR /&gt;await hrefElement.click();&lt;/P&gt;&lt;H1&gt;(node:31864) UnhandledPromiseRejectionWarning: TimeoutError: elementHandle.click: Timeout 30000ms exceeded.&lt;BR /&gt;=========================== logs ===========================&lt;BR /&gt;[api] attempting click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;BR /&gt;[api] element is visible, enabled and does not move&lt;BR /&gt;[api] scrolling into view if needed&lt;BR /&gt;[api] done scrolling&lt;BR /&gt;[api] checking that element receives pointer events at (948.83,198.06)&lt;BR /&gt;[api] element does not receive pointer events&lt;BR /&gt;[api] retrying click action&lt;BR /&gt;[api] waiting for element to be visible, enabled and not moving&lt;/H1&gt;&lt;P&gt;Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.&lt;/P&gt;&lt;P&gt;Looking at the Chrome Dev Tools inspection, this is what I get for different portions of the element for search button.&lt;/P&gt;&lt;PRE&gt;	SearchButtonOutter
	"copy selector"
	#sandbox-host &amp;gt; div &amp;gt; button.c-glyph.search-button

	"copy JS Path"
	document.querySelector("#sandbox-host &amp;gt; div &amp;gt; button.c-glyph.search-button")

	"copy element":
	&amp;lt;button class="c-glyph search-button" name="search-button"&amp;gt;
	                                          &amp;lt;span class="x-screen-reader"&amp;gt;Search&amp;lt;/span&amp;gt;
	                                        &amp;lt;/button&amp;gt; 

	SearchButtonInner
	there isn't anything to copy for the element, but I can get this from the inspect styles section
	.visual-textFilter25A4896A83E0487089E2B90C9AE57C8A .text-filter-search button.search-button:before {&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could use some help on the right way to reference the click method for the buttons. I have attached screen shots to show you what I am trying to click on.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SearchButtonInner.JPG" style="width: 974px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/356276iF2B8D45BB5D3C4E8/image-size/large?v=v2&amp;amp;px=999" role="button" title="SearchButtonInner.JPG" alt="SearchButtonInner.JPG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SearchButtonOutter.JPG" style="width: 927px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/356277i8948CA41F91BAC47/image-size/large?v=v2&amp;amp;px=999" role="button" title="SearchButtonOutter.JPG" alt="SearchButtonOutter.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 15 Sep 2020 14:59:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372438#M25718</guid>
      <dc:creator>wadezone</dc:creator>
      <dc:date>2020-09-15T14:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Report testing Automation (using Playwright) - unable to click button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372457#M25719</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/397"&gt;@dm-p&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/234736"&gt;@wadezone&lt;/a&gt;&amp;nbsp;Have you seen this article?&amp;nbsp;&lt;A href="https://powerpivotpro.com/2018/09/automated-testing-using-dax-for-power-bi/" target="_blank"&gt;https://powerpivotpro.com/2018/09/automated-testing-using-dax-for-power-bi/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:05:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372457#M25719</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-09-15T15:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Report testing Automation (using Playwright) - unable to click button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372811#M25725</link>
      <description>&lt;P&gt;Not sure why my reply back wasn't working. Third attempt. Thanks Greg for the link to the article. No, I had not seen that. My testing needs to mimic the user's experence within the visuals. Our reports do use DAX queries but not from the original source. I can see maybe trying to incorporate the DAX Sudio to query against the original source and then verify it against the visual. It is definitely something I will check out. To mimic the user's&amp;nbsp;maniuplation of the visuals I will still need to automate the objects on the report in the website.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case someone else is trying to get the button action to happen, I did get this to work with the frame object but not the page. I did the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;const test = await frame.evaluate(() =&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;document.querySelector("#sandbox-host &amp;gt; div &amp;gt; button.c-glyph.search-button").click()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 17:24:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1372811#M25725</guid>
      <dc:creator>wadezone</dc:creator>
      <dc:date>2020-09-15T17:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Report testing Automation (using Playwright) - unable to click button</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1886468#M29820</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/313"&gt;@Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for sharing the link.&amp;nbsp; Do you think that the approach suggested in your link would work on a report which has been authored on top of a shared dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please bear in mind that the report has DAX functions which I would like to test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sau&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jun 2021 21:45:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Report-testing-Automation-using-Playwright-unable-to-click/m-p/1886468#M29820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-07T21:45:07Z</dc:date>
    </item>
  </channel>
</rss>

