[Question] How to calculate the total number of elements available for a xpath in playwright
See original GitHub issueTrying to capture multiple elements using below xpath
const elements = "xpath=//*[text()='Table']/parent::*//tbody//tr";
getting a total of 50 element for the above xpath in inspect window.
Trying to store all these element using
let value = await this.page.$$(txtBillingRoasterTableRows);
console.log("value length is ",value.length);
but getting value.length as 1. How can I get the expected total of 50?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
How to get a collection of elements with playwright?
I have already found the answer. Need to use page.$$(selector) instead of page.$(selector) to grab like document.
Read more >How To Find Elements For Selenium, Cypress, Playwright
This video explains how to find elements for Selenium WebDriver, Cypress and Playwright using SelectorsHub Chrome Extension and Firefox ...
Read more >Find Multiple Elements | Playwright - Part 12 - YouTube
Let's learn how to find multiple elements in the playwright.We are also going to explore the "for await" and "map" functions.
Read more >16 - Comma separated CSS Selectors and Xpath Union
In this video, I have explained how to use Comma separated CSS Selectors and Xpath Union || Playwright with Java.git repo url ...
Read more >Complete Guide For Using XPath In Selenium With Examples
We will be digging into the steps of locating an element by XPath in Selenium with examples, to help you understand various ways...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You should not wait for the time, you should wait for elements:
the number of rows 😏