cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wadezone
Frequent Visitor

Using Node.js (Playwright) how to utilize columnHeader; rowHeader instead of nth-child

Trying to use playwright to automate testing Power BI reports like the user would click. I am trying to "get" a value from a visual. I have it working using the nth-child(#) or nth-of-type(#). 

 

Example.

These work to click or "get" the value:

awaitpage.click('.bodyCells > :nth-child(1) > :nth-child(1) > :nth-child(4) > div:nth-of-type(1)'); 

 

consttest4 = awaitpage.textContent('.bodyCells > :nth-child(1) > :nth-child(1) > :nth-child(4) > div:nth-of-type(1)'); 

console.log(test4); 

 

consttest5 = awaitpage.textContent('.bodyCells > :nth-child(1) > :nth-child(1) > :nth-child(4) > :nth-child(1)'); 

console.log(test5);

 

constelementByClass = awaitpage.$('.bodyCells > :nth-child(1) > :nth-child(1) > :nth-child(4) > div:nth-of-type(1)') 

constinnerText = awaitelementByClass.innerText() 

console.log(innerText) 

 

Is there a way to not use the "nth-child" and actually reference the "div title=rowHeader name" and the "div title = columnHeader name" to "get" the value in that cell of this visual. example below get 258,886.064 

 

cell.JPG

0 REPLIES 0

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.