cancel
Showing results for 
Search instead for 
Did you mean: 
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 III
Super User III

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.