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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
karimm
Helper II
Helper II

xpath of visuals changing even when report is not changed

Hi All

 

I have a report that is embedded in a PowerApp and we need to create PPTs from all pages in the PowerApp, including my PBI report.

We have considered many solutions, and currently we are trying to do it via UI automation.

The report includes a slicer and the automation needs to iterate over the slicer values and take a screenshot after each selection.

The automation tool being used, Ginger, identifies the elements on the screen using xpath.

Our developer is facing a problem where the xpath of the visuals is not constant. 

 

Even without publishing a new version of the report, one day the xpath might be one day like this:

/html[1]/body[1]/div[3]/iframe[1],/html[1]/body[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[11]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/iframe[1]

 

And next day, it's like this:

/html[1]/body[1]/div[3]/iframe[1],/html[1]/body[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[7]/div[1]/div[1]/div[1]/div[1]/div[1]/div[15]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/iframe[1]

 

Any idea what triggers the change in these xpaths?

Is there a way to keep them constant?

 

Thanks a lot in advance 🙂

7 REPLIES 7
lbendlin
Super User
Super User

You should consider printing out the PPT, scanning it in and then storing the scans in a PDF...

 

Have you considered using the Dataset.ExecuteQueries API instead?

Thank you so much for the reply.

 

To be honest, I'm not sure I understand the recommendation 🙂

Can you please elaborate?

 

I checked the Dataset.ExecuteQueries API documentation. How does that help in taking the relevant screenshots of different slicer values?

What I am trying to point out is that your process design might need some rethinking. What is your ultimate business goal?

The PowerApp and embedded PowerBI contain data describing the current status (the NOW). 

Users would like to product slides from all pages/reports for 2 reasons:

 - future reference.

 - sending the slides to external users who cannot have access to the app.

Here is my personal, biased opinion:

 

#1: That's what properly maintained database tables are for

#2: That smells like a data security issue and a potential licensing issue.

About having everything in DB, that it is of course a valid option, but it's too complex for our needs. And regarding the security , each user is responsible for the data he/shes and knows to whom slides can be sent or not.

 

Now, I'm sure you are aware that PowerBI workspaces do have the option to create PPT/PDF for a report. In view if your 2 points above, would you tell the PowerBI team that they shouldn't provide this option? 🙂

 

Let's go back to original question: any idea why and when xpaths of visuals are modified?

 

With every single release of Power BI desktop you can assume that there is a buddy release of Power BI Service to keep the query engines in sync. At the same time Microsoft keeps tuning the rendering process, especially now since they are migrating to the WebView2 renderer.

Power BI July 2021 Feature Summary | Microsoft Power BI Blog | Microsoft Power BI

You have to expect your xpath to be volatile.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors