The following method will allow you to simulate a drag-and-drop action in Puppeteer:
1 2 3 4 5 6 7 | const example = await page.$('#example'); const bounding_box = await example.boundingBox(); await page.mouse.move(bounding_box.x + bounding_box.width / 2, bounding_box.y + bounding_box.height / 2); await page.mouse.down(); await page.mouse.move(126, 19); await page.mouse.up(); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.