Skip to content

Commit e5dca2a

Browse files
DavertMikclaude
andcommitted
fix: use page instead of context for moveCursorTo context lookup in Puppeteer
In Puppeteer, this.context is scoped to <body>, so searching for "body" within it returns empty. Use this.page directly to find the context element from the document root. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 15be2b7 commit e5dca2a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/helper/Puppeteer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,7 @@ class Puppeteer extends Helper {
829829

830830
let el
831831
if (context) {
832-
const contextPage = await this.context
833-
const contextEls = await findElements.call(this, contextPage, context)
832+
const contextEls = await findElements.call(this, this.page, context)
834833
assertElementExists(contextEls, context, 'Context element')
835834
const els = await findElements.call(this, contextEls[0], locator)
836835
if (!els || els.length === 0) {

0 commit comments

Comments
 (0)