I'm hoping someone here can help me with this issue that I'm having with automated testing.
I am testing with Nightwatch.
I am upgrading to Selenium 4. Everything is working except for one issue. One of the things I do in my scripts is I do control click and shift click. I need to have a have a new tab or new window for my testing.
Until now (in Selenium 3) I would code like this: client.keys(client.Keys.SHIFT) or client.keys(client.Keys.CONTROL) and then I would do the click command. This would open the link in a new tab or window.
I also tried just doing Keys.CONTROL (omitting the word client) it didn't seem to make a difference.
Since I upgraded it doesn't open in a new tab. The link opens but ignores the fact that I did CONTROL click.
I tried many different combinations using either webdriver or selenium-webdriver as shown.
const driver1 = require("webdriver");
const driver2 = require('selenium-webdriver')
driver1.actions().keyDown(Keys.SHIFT).perform();
I get this error: driver1.actions is not a function
driver1.actions.keyDown(Keys.SHIFT).perform();
I get this error: Cannot read properties of undefined (reading 'keyDown')
driver2.Actions.keyDown(client.Keys.CONTROL).perform()
I get this error: Cannot read properties of undefined (reading 'keyDown')
client.keys(client.Keys.CONTROL) or client.keys(Keys.CONTROL)
then click: ignores the CONTROL and just clicks
Any tips would be greatly appreciated!!
Thanks!!!
You need to do the following in Selenium
And in NightwatchJS you would do the follow