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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
VitoC
New Member

Clicking on a PowerBi Dashboard reports with Selenium

Hello there,

I posted a message yesterday but it seems to have disapeared, i'm new here...

 

Ok, my problem is that I dont success to click on a Dashboard widget (ChartPie for example) using selenium.

 

When the PowerBi widget is not embedded in Html (generally has a Id in the Html code, <div id="container" class="e-datavisualization-chart e-js"....... ), I can easily click on it or on a particular object in the widget (for example a point in a Graph). but when it comes to get to slices in a chartPie (BUT On which we can perform a Focus Mode,  or Export Data on it... ), I cant get them.

 

In fact, its html code is very different as the other one, (embedded code) and there are no id tags (a lot of div and class, though, like: <div class="visualContainer unselectable ng-isolate-scope......... ). I failed to grab an Element using all the Get choices in Selenium (other Bys, like CssSlector, tagname, class, even XPath isnt working), do you know why? I cant click on any widget in the mainwindow (central) Does someone know how to click on a particular embedded report object??

 

Thank you for helping me out!

1 ACCEPTED SOLUTION

Ok, I found the solution, it was because it was in a frame and i had to switch to this frame before getting anything.

 

Browser.WebDriver.SwitchTo().Frame(myFrame);

 

Hope it will be helpful to someone

View solution in original post

5 REPLIES 5
VitoC
New Member

Hello there,

I am doing some automatic testing using selenium and I have a Page with some PowerBI widgets. When the widget is not embedded in the html code (I can get Id of the widget like <div id="ReviewPositioning" class="e-datavisualization-chart e-js" .... ), I success to find one object in this widget (for example a point in a Chart) but when it is embedded like a report (several widgets with "Focus mode" or "Export Data" possible), In the html I see only div classes but very few Ids and i cant find anything with the other Bys (selector, tagname, classname, or even XPath),  nothing is working !!

Does anyone have some advice for me? 

 

Thanks in advance

Guillaume

 

Eric_Zhang
Microsoft Employee
Microsoft Employee

@VitoC

According to your description, the question seems how Selenium can get the html elements of Embedded Power BI reports. I suggest you post the question in the dedicated Selenium forum and you will get better response there.

@Eric_Zhang

 

Thanks for your answer, ill try on Selenium forum. So frustrating I can get some of the widgets but not the embedded ones...

Ok, I found the solution, it was because it was in a frame and i had to switch to this frame before getting anything.

 

Browser.WebDriver.SwitchTo().Frame(myFrame);

 

Hope it will be helpful to someone

Anonymous
Not applicable

I'm with the same proble, but I didn't understand how you did it. Which version of selenium you are using? How did you identify which dataframe you need to access? 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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