mardi 22 mai 2018

Sending COMMAND or CTRL key in nightwatch to close browser tab

Iam trying to close a tab on Chrome/IE browsers in Nightwatch Its accepting all the keys other than CTRL in Windows or COMMAND in Mac.

loginPage.sendKeys("@login", [client.Keys.CONTROL, "w", ]);

All of the below work as expected

 loginPage.sendKeys("@login", [client.Keys.SHIFT, "w", ]);
 loginPage.sendKeys("@login", [client.Keys.ENTER, "w", ]);
 loginPage.sendKeys("@login", [client.Keys.SEMICOLON, "w", ]);

I can close the tab using closeWindow funtion, but it doesnt invoke the beforeunload event of browser close. I think its killing the Chrome/IE process instead of closing it.So i am looking for an alternate way to close the tab in nightwatch.

Aucun commentaire:

Enregistrer un commentaire