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
HarjyotKaur
New Member

Automation Testing using Selenium

Hi,

 

I am trying to automate my Power BI report validation. Basically, we want to make sure that the output generated on the report matches the datasource manipulation. For that, I am using Selenium to extract the values of the objects using their Xpath or Css selector. The challenge is everytime I run my script, the path changes. Does anyone know why does that keep happening. I checked with the developers and they assured that nothing from the UI got changed.

Is there any other tool for automation testing?

Any help is much appreciated!

 

Thanks,

Harjyot

5 REPLIES 5
tanurai
New Member


It sounds like you're experiencing dynamic changes in the HTML structure of your Power BI report, causing the XPath or CSS selectors to become unreliable. This could happen due to various reasons, such as updates to the Power BI platform or changes in how the report is rendered in the browser.

One alternative approach you could consider is using tools specifically designed for web automation testing, such as Cypress or Puppeteer. These tools offer robust features for interacting with web elements and handling dynamic changes more effectively compared to Selenium.

Cypress, for example, provides automatic retries and built-in waiting mechanisms, which can help mitigate issues caused by dynamic changes in the UI. Additionally, it offers a user-friendly API and comprehensive documentation, making it relatively easy to get started with test automation for your Power BI reports.

By leveraging dedicated web automation testing tools like Cypress or Puppeteer, you may find it easier to maintain reliable and stable test scripts for validating your Power BI reports, even in the face of dynamic changes in the UI.

Anonymous
Not applicable

Hey everyone. 

I am about to start testing PowerBI reports trough an azure devops pipeline. Unfortunately I am receiveing an error message that My sign-n was successfull, but does not meet the criteria to access this reqource. Does anyone know by any chance which permissions do I need to have for the user to be able to access?

THank in advance for youe help.

 

Best Regards

Brendon
Frequent Visitor

@HarjyotKaur what kind of selectors are you using? I've had some luck in using CSS selectors and requesting developers to put alt-text on all charts I need to interact with. In the DOM, you'll see the alt-text as "aria-label" attributes, so you can write CSS selectors like, "div.slicer[aria-label*=\"YOUR_ALT_TEXT\"]". These tend not to change much as long as you find the right element to use. 

 

As for your question about other tools, I developed PowerTester after going down the selenium route for a client and finding that the amount of work involved in creating and maintaining tests became the bottleneck for our team. 

Syndicate_Admin
Administrator
Administrator

Hi! I'm going to write Portuguese, and I hope you can understand. Are you using Selenium through Power BI service or desktop?
I'm trying to do something like that in an online report, but the script can't interact with the elements.
My goal is to automatically export the data from a table in the visual.
Can you use filters and select elements with Selenium? Any tips that can help me?

thanks!

Greg_Deckler
Super User
Super User

@HarjyotKaur No specific tools that I know of but there is a blog article for DAX testing:

https://powerpivotpro.com/2018/09/automated-testing-using-dax-for-power-bi/

 

No idea about Selenium. Would need to know more about the script and how it is accessing the report.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors