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

As for puppeteer to emulate the movement of the mouse while pressing? #3221

Closed
StasToken opened this issue Sep 9, 2018 · 3 comments
Closed
Assignees

Comments

@StasToken
Copy link

  • Puppeteer version:1.5.0
  • Platform / OS version: Ubuntu
  • Node.js version: v8.9.4
    Hello everyone, using puppeteer to automate testing, the question Arose, does anyone know how to click on an item with the mouse (left mouse button ) and without releasing the left mouse button to move it to the right 50px? Here's how to click I know how to move the cursor, I also know, but how to make so that the left mouse button was pressed during the transfer of the mouse will not understand anyone faced with such a task? tell me how to do it?
@Akxe
Copy link

Akxe commented Sep 14, 2018

There is Mouse class, you can use press(x,y), move(x,y), release(x,y). No idea how to get mouse thought, yet.

aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Sep 14, 2018
@aslushnikov
Copy link
Contributor

@Akxe @StasToken you can get mouse with page.mouse getter

await page.mouse.move(100, 100);
await page.mouse.down();
await page.mouse.move(200, 200);
await page.mouse.up();

@StasToken
Copy link
Author

Many thanks!

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