Reputation: 35
Im working on the facebook php webdriver,im working on Ubuntu with selenium standalone server in the same directory as the webdriver library .
Im connecting to the linux using local ip address as 192.168.x.x ,When i execute the below code
<?
require '__init__.php';
$wd_host = 'http://localhost:4444/wd/hub';
$web_driver = new WebDriver($wd_host);
$session = $web_driver->session('firefox');
?>
i constantly get this error "Uncaught exception 'UnhandledWebDriverError' with message 'Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: Error: no display specified "
Someone can point out where im going wrong?
Thanks
Upvotes: 2
Views: 1668
Reputation: 741
I've just started working on PHPUnit Selenium test suites and had the same error when I was setting up on our dev server.
Check to see if you have Xserver installed, and if it is installed, make sure the server is running. Then make sure the DISPLAY variable is set in the environment in which you are starting Firefox. "Error: no display specified" is Firefox's way of complaining that it can't find a server for it to use to display the browser window.
For reference:
How can I specify a display? (stackoverflow.com)
Ubuntu Package: xserver-xorg-core (packages.ubuntu.com)
Xserver manpage (manpages.ubuntu.com)
If you're curious about the port 7055 message, which is probably a cascade failure due to not having a display:
Good luck and have fun.
.david
Upvotes: 2