java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
I have installed xvbf , chrome browser and chrome driver successfully on Linux VM. Please let me know if you had encountered this issue earlier
Thanks & Regards,
Vikram
#!/bin/bash
S1="$(wget --server-response http://127.0.0.1:4444/wd/hub/static/resource/hub.html 2>&1 | awk '/^ HTTP/{print $2}')"
if [ x$S1 = x200 ];
then
echo "Selenium is running."
else
echo "Turning on Xvfb and Selenium..."
sudo Xvfb :10 -screen 0 1366x768x24 -ac > /dev/null 2>&1 &
sudo DISPLAY=:10 nohup xvfb-run java -jar /usr/local/bin/selenium-server-standalone-2.50.0.jar -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver &
until [ x$S1 = x200 ]; do
sleep 5
echo "..."
S1="$(wget --server-response http://127.0.0.1:4444/wd/hub/static/resource/hub.html 2>&1 | awk '/^ HTTP/{print $2}')"
done
echo "OK."
fi
echo "Starting tests..."
# cmd to start your tests...