1
votes

I am trying to get Protactor.js unit testing up and running with Jenkins on a windows server but I am having trouble getting it to run.

Currently this is the steps I have so far:

#install protractor via package.json
cd ./src/My\ Editor/WebApp/Scripts/protractor && D:Jenkins/nodesjs/npm install

[other build steps here]

#start webdriver-manager
./src/My\ Editor/WebApp/Scripts/protractor/node_modules/protractor/bin/webdriver-manager start > /dev/null 2>&1 &

#wait until selenium up
while ! curl http://localhost:4444/wd/hub/status &>/dev/null
do
  true
done

#run protractor
cd ./src/My\ Editor/WebApp/Scripts/protractor/node_modules/protractor/bin/

./protractor ../../../conf.js

#stop selenium
curl -s -L http://localhost:4444/selenium-server/driver?cmd-shutDownSeleniumServer > /dev/null 2>&1

everything works well until the command 'protractor conf.js'. I get this output:

[21:12:34] I/hosted - Using the selenium server at http://localhost:4444/wd/hub [21:12:34] I/launcher - Running 1 instances of WebDriver [21:12:34] E/launcher - Error forwarding the new session empty pool of VM for setup capabilities [{count=1, browserName=chrome}]

Any help for what I am doing wrong is appreciated, thank you.

1
Can you try below suggestion and see if it works ! - AdityaReddy

1 Answers

0
votes

Is there a specific need to start a Selenium Server/hub? If you dont have a plan to setup a Selenium GRID and you just need to run protractor test scripts stand-alone you can skip the part where you are starting server.

Can you leave the remove seleniumAddress option in Protractor.conf.js. This will enable Protractor to start its own selenium server & wait till server is completely up and execute and will shutdown the server once execution is done

More information here

  /**
   * The address of a running Selenium Server. If specified, Protractor will
   * connect to an already running instance of Selenium. This usually looks like
   * seleniumAddress: 'http://localhost:4444/wd/hub'
   */
  seleniumAddress?: string;

just have the step #run protractor and rest is taken care by Protractor