How to press CTRL+J (and CTRL+W) keys with Nightwatch.JS
Asked 07 September, 2021
Viewed 2.5K times
  • 59
Votes

I need to close Chrome download bar with Nightwatch.JS. In order to do so I want to press CONTROL+J and then CONTROL+W.

However, the following code doesn't work:

client.keys([client.Keys.CONTROL, "Ue006A"]);

Neither works:

client.keys([client.Keys.CONTROL, "j"]);

The thing is pressing CTRL+A in the same manner selects everything on the page. The following code works just fine:

client.keys([client.Keys.CONTROL, "a"]);

But not the CTRL+J.

Anyone has an idea how to solve this?

1 Answer