How do I utilize katalon studio to test visual display in POWERBI. Please note that data in powerBI comes from views in Database and it should match the displayed reports along with tool-tips(if any)
1 Like
1. Test Power BI Visuals and Tooltips via Web UI Automation
- Use Katalon’s WebUI keywords to interact with and verify Power BI reports as rendered in the browser.
- Validate presence, formatting, and layout of charts, tables, and graphs.
- Use keyword actions (like
WebUI.mouseOver) to trigger and capture tooltips, then assert the content matches expectations.
2. Verify Data Accuracy with Database Queries
- Use Katalon’s Database Testing capabilities or custom JDBC code to connect to the source database.
- Query the same database views/tables that Power BI uses for the displayed report.
- Compare table data, chart totals, or calculated business metrics to ensure consistency between UI and backend.
3. Sample Steps for Visual and Data Assertions
- Open Power BI Report
groovy
WebUI.openBrowser('')
WebUI.navigateToUrl('PowerBI_Report_URL')
- Validate Chart/Table Data
- Use
WebUI.getText,WebUI.verifyElementText, orWebUI.getAttributefor displayed data.
- Use
- Validate Tooltips
groovy
WebUI.mouseOver(findTestObject('ChartElement'))
// Use delay if needed to let tooltip appear
String tooltipText = WebUI.getText(findTestObject('TooltipElement'))
WebUI.verifyMatch(tooltipText, expectedPattern, false)
- Fetch Backend Data
groovy
import groovy.sql.Sql
def db = Sql.newInstance(dbUrl, user, password, driverClass)
def result = db.firstRow('SELECT SUM(metric) FROM source_view WHERE ...')
db.close()
// Compare with Power BI data from UI
WebUI.verifyMatch(uiValue, result.metric.toString(), false)
4. Combine as an End-to-End Test
- Automate data entry/setup if required, trigger Power BI report generation, verify display and tooltip values on UI, fetch expected data from database, and assert both match.
Recommendations
- Identify stable UI locators for Power BI visuals and tooltips (may need attributes, CSS selectors, or XPath).
- Automate across different browsers and resolutions for thorough visual validation.
- Regularly synchronize your SQL/database access with BI report refresh cycles for consistent comparisons.
How To Approach Power BI Testing with Katalon Studio
1. Automate UI Interactions for Visual Verification
- Use Katalon’s WebUI steps to open the Power BI report URL.
- Use
WebUI.verifyElementPresent,WebUI.getText, andWebUI.verifyMatchon chart values or table cells. - To check tooltips, trigger tooltip displays via
WebUI.mouseOverand extract their text for validation.
2. Fetch and Compare Database Data
- Use Katalon’s Database utility or a Groovy JDBC script to query the corresponding database views that Power BI uses.
- Example (Groovy SQL):
groovy
import groovy.sql.Sql
def sql = Sql.newInstance(jdbcUrl, user, password, driver)
def expectedResult = sql.firstRow("SELECT SUM(sales) AS total FROM sales_view")
sql.close()
// ... now compare this expectedResult with visual data from UI
3. Validation
- Compare the numbers and details in the Power BI visuals/tooltips fetched by Katalon with the data from your database query.
- You might need to implement a custom matching logic or rounding for float values.
4. Typical Steps in Test Script
- Open and authenticate to Power BI.
- Navigate to the relevant dashboard/report.
- Extract displayed data and tooltips.
- Fetch backend data from the right DB view.
- Compare frontend results to backend data.
- Validate display logic for tool-tips (e.g., using mouseover or advanced selectors).