Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Playwright support] Uncaught TypeError: elem.remoteObject #121

Open
electrumguy opened this issue Feb 21, 2024 · 3 comments
Open

[Playwright support] Uncaught TypeError: elem.remoteObject #121

electrumguy opened this issue Feb 21, 2024 · 3 comments

Comments

@electrumguy
Copy link

electrumguy commented Feb 21, 2024

I am getting this error:

Uncaught TypeError TypeError: elem.remoteObject is not a function
    at <anonymous> (...\node_modules\ghost-cursor\lib\spoof.js:483:61)
    at step (...\node_modules\ghost-cursor\lib\spoof.js:44:23)
    at <anonymous> (...\node_modules\ghost-cursor\lib\spoof.js:25:53)
    at fulfilled (...\node_modules\ghost-cursor\lib\spoof.js:16:58)

Sample code to regenerate:

import { chromium } from 'playwright';
import { createCursor } from "ghost-cursor"

const example = (async () => {
        const browser = await chromium.launch({ headless: false });
        const page = await browser.newPage();
        const cursor = createCursor(page)
        await page.goto('https://www.example.com/')
        await cursor.click('body > div:nth-child(1) > p:nth-child(3) > a:nth-child(1)', { waitForClick: 10000, waitForSelector: 10000, paddingPercentage: 20 })
})();

Utilizing:
"@playwright/browser-chromium": "^1.41.2"
"ghost-cursor": "^1.2.0",

@Niek
Copy link
Collaborator

Niek commented May 8, 2024

As stated, ghost-cursor is a library for puppeteer and not for playwright. It should be possible to add playwright support though, feel free to open a PR.

@Niek Niek changed the title Uncaught TypeError: elem.remoteObject [Playwright support] Uncaught TypeError: elem.remoteObject May 8, 2024
@unickq
Copy link

unickq commented Sep 3, 2024

@sanchobouillant
Copy link

sanchobouillant commented Oct 1, 2024

I have the same issue with puppeteer when I use a locator.

    const testButton = await page.locator('button');
    await cursor.click(testButton);
TypeError: elem.remoteObject is not a function
    at Object.<anonymous> (node_modules/ghost-cursor/lib/spoof.js:521:61)
    at step (node_modules/ghost-cursor/lib/spoof.js:44:23)
    at Object.next (node_modules/ghost-cursor/lib/spoof.js:25:53)
    at node_modules/ghost-cursor/lib/spoof.js:19:71
    at new Promise (<anonymous>)
    at __awaiter (node_modules/ghost-cursor/lib/spoof.js:15:12)
    at go (node_modules/ghost-cursor/lib/spoof.js:474:64)
    at Object.<anonymous> (node_modules/ghost-cursor/lib/spoof.js:579:50)
    at step (node_modules/ghost-cursor/lib/spoof.js:44:23)
    at Object.next (node_modules/ghost-cursor/lib/spoof.js:25:53)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants