I have a shell script to register the node machine to hub at startup.
The script contains:
java -jar ~/selenium/selenium-server.jar -role node -hub http://HUB_IP:4444/grid/register -browser browserName="firefox",maxInstances=5,Platform="LINUX",applicationName="VM_NAME" -browser browserName="chrome",maxInstances=5,Platform="LINUX",applicationName="VM_NAME" -Dwebdriver.chrome.driver=~/selenium/chromedriver
The script starts fine in the startup and even the node gets registered to hub, but, when I start a job from Jenkins its gives below error in case of Firefox:
FAILED CONFIGURATION: @BeforeClass setup org.openqa.selenium.WebDriverException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Error: no display specified
When I start a job from Jenkins its gives below error in case of Chrome:
FAILED CONFIGURATION: @BeforeClass setup org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 3.13.0-68-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Note: 1. Using later version of chrome, firefox & Selenium jar files 2. When the script is run manually, everything works fine. 3. Start up batch file in windows works fine without any problem.