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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

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
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.