0

I have a question in regards to Playwright and whether there is a way to sign an electronic signature into a canvas element using the mouse(hold and move the mouse around to simulate a signature) and of course it should be a way longer signature than a dot or a couple of dots but more like a real signature as the application does not allow me to continue with only having a dot or two as a signature.

Also I am not able to do this through codegen as I thought it would work.

Would be thankful for any ideas regarding this issue if any had similar, thanks!

ciconq
  • 201
  • 1
  • 2
  • 11

1 Answers1

0
 public async drawTheSignature() {
module2Page = new Module2Page();
const rect = await module2Page.signatureField.boundingBox();
await module2Page.signatureField.scrollIntoViewIfNeeded();
await page.mouse.move(rect.x + 10, rect.y + 10);
await page.mouse.down();
await page.mouse.move(rect.x + 100, rect.y + 100);
await page.mouse.move(rect.x + 200, rect.y + 100);
await page.mouse.move(rect.x + 200, rect.y + 130);
await page.mouse.up();

}

Polza
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 10 '23 at 03:48