0

I'm using nightwatch to run tests in parallel. I would like to be able to run multiple tests at a time in different selenium processes. How can I accomplish that?

What I did is create a selenium hub:

java -jar /opt/selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver -Dwebdriver.chrome.bin=/usr/bin/google-chrome  -log /home/jenkins-user/log/selenium.log  -role hub & 

And when each test runs, I create a node:

java -jar /opt/selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=/usr/bin/chromedriver -Dwebdriver.chrome.bin=/usr/bin/google-chrome  -log /home/jenkins-user/log/selenium.log  -role node  -browser browserName=chrome -hub http://localhost:4444/grid/register & 

Unfortunately, this prevents me from running nightwatch tests in parallel.

What am I doing wrong?

Chris Hansen
  • 7,813
  • 15
  • 81
  • 165
  • Well, you're not using the native parallel support available (and are instead trying to do something outside the scope of what constitutes "normal" parallel test running for Nightwatch). If using a single selenium session for each test which is run and tests distributed per CPU (http://nightwatchjs.org/getingstarted#basic-settings) you will have one selenium session per test, per CPU. Is that not what you desire? – GrayedFox Feb 03 '17 at 12:37

1 Answers1

0

Why do you want to start multiple selenium processes? You should not do that.

Check my answer for similar question: Running multiple nightwatch instances

Community
  • 1
  • 1
nirmus
  • 4,913
  • 9
  • 31
  • 50