mardi 27 novembre 2018

COPY - PASTE usign nightwatchjs selenium

I'm using nightwatchjs for testing purpose (http://nightwatchjs.org/). In a page I need to simulate COPY and PASTE action. While copying it's not a problem, pasting it is because I can not stick with an implementation. For example in Windows I can do:

browser.keys([browser.Keys.CONTROL, "v"])

But sometimes I use MAC and it doesn't work because I have to use COMMAND instead of CONTROL and the following code doesn't work:

browser.keys([browser.Keys.COMMAND, "v"])

So I'm trying to use something that simulate the right click of the user and the selection of the Paste option from the contextual menu. I can open the contextual menu with

client.mouseButtonClick('right');

But

How can I select the "Paste" option from the contextual menù in nightwatchjs?

Aucun commentaire:

Enregistrer un commentaire