Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wadezone
Frequent Visitor

How to handle non blank space "title" names reference scripting in JS or Playwright

I am using playwright to automate Power BI reports to manulate the reports like the user would along with getting the data values from the report to validate the original source database. 

 

I am trying to click on rows within a class ="pivotTableCellWrap cell-interactive tablixAlignRight" for a visual. When clicked it adjust the reports based on the row selected.  I can get the click to work when the title is a single word, but not when there is more than 1 word titles. 

 

This works

await page.waitForTimeout(500);
await page.click("[aria-label='Unidentified (Not Claimed) Performances Matrix'] [title='Unidentified']");
await page.waitForTimeout(500);
await page.click("[aria-label='Unidentified (Not Claimed) Performances Matrix'] [title='20194']");

 

This doesn't work; I tried two different ways.

await page.waitForTimeout(500);
await page.click("[aria-label='Unidentified (Not Claimed) Performances Matrix'] [title='Unprocessed Performances']");
await page.click("[aria-label='Unidentified (Not Claimed) Performances Matrix'] [title='Unprocessed Performances']");

 

For every single word title I can get the click to happen. For every word greater than 1 word titles it fails with timeout 3000ms exceeded. When I copy the value from the Chrome Dev Tools it doesn't give me the non blank space version.

 

Need to click on a row within a Power BI report for the visuals to adjust based on the selected click. When I code for the click it works for a single word title label, but doesn't work for any title with a space; two ore more words for title.

 

DoesntWork.JPG

 

6 REPLIES 6
lbendlin
Super User
Super User

I think your Playwright tool has a hard time properly handling   - it seems to replace & with %. Or did you write that part yourself?

@lbendlin ... Oops, that was a typo. When I typed it out in the message. I corrected it. It should have been &.

 

I am wondering if there is something in Power BI that would cause the %nbsp between the words. I am not the Power BI expert, but I was able to create a little pbix file with the same data the developers used and when I look at it in Chrome Dev Tools I don't get the &nbsp. I have asked the developers to look into it. 

 

Do you by chance know what in Power BI would cause it to do that on the underlying visual?

 

That would be a question fo the Power BI Development team, specifically the browser renderer department. I wouldn't be surprised if they had different code paths for different (sniffed) bowsers too.

@lbendlin 

 

Our reports are to be used in only Chrome at this time. 

Version 85.0.4183.83 (Official Build) (64-bit)

 

I checked Microsoft Edge.

Microsoft Edge 42.17134.1098.0

Microsoft EdgeHTML 17.17134 

 

I noticed when I inspected the elements they do not have the  . I had the Power BI development team to help me determine what is causing this. We found that Power BI report "word wrap" setting is causing the  . If it is turned on (the default), the Chrome Dev Tools shows the elements with a space and without the  . On the reports I am trying to setup the automation on the "word wrap" is off and is giving us the  . 

 

Our internal site is to access the Power BI reports using Chrome. We don't have a browser renderer department. Is there any additional information that you can provide that would assist with this issue? Is there a Chrome setting that might fix this problem. The word wrapp is setting per the business requirement so currently setting it on is not an option. Thanks for your input. 

 

Theresa

I was referring to the Power BI Development team at Microsoft, not at your company.

Oh okay, thanks. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.