Skip to content

Commit 2ff912e

Browse files
committed
fix: add missing return statement for XPath in findElements
- Fixed findElements to return matcher.$x(locator.value) for newer Puppeteer versions - This was causing 'Cannot read properties of undefined (reading length)' errors
1 parent c0646ea commit 2ff912e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/helper/Puppeteer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,8 @@ async function findElements(matcher, locator) {
28712871
if (puppeteer.default?.defaultBrowserRevision) {
28722872
return matcher.$$(`xpath/${locator.value}`)
28732873
}
2874+
// For newer Puppeteer versions, use $x for XPath
2875+
return matcher.$x(locator.value)
28742876
}
28752877

28762878
/**

0 commit comments

Comments
 (0)