PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

182 views
Skip to first unread message

dimuthu

unread,
Oct 4, 2011, 10:44:50 PM10/4/11
to Selenium Users
I'm using wamp, PHPUnit and selenium RC server. While running a simple
selenium TC, I'm getting the following error.

PHPUnit_Framework_Exception: Could not connect to the Selenium RC
server.

My php code is
.............................................................................

<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';

class WebTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setHost("localhost");
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://www.facebook.com/');
$this->setPort(4444);
$this->setTimeout(50000);

}

public function testTitle()
{
$this->open('http://www.facebook.com/');

}
}
?>
........................................................................................................................


Please help me to resolve this.

Nicolas Dermine

unread,
Oct 5, 2011, 1:53:50 PM10/5/11
to seleniu...@googlegroups.com

Hi,

Could you describe how you start the selenium server?

Nico

> --
> You received this message because you are subscribed to the Google Groups "Selenium Users" group.
> To post to this group, send email to seleniu...@googlegroups.com.
> To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
>

dimuthu

unread,
Oct 5, 2011, 10:23:40 PM10/5/11
to Selenium Users
Hi Nicolas,

Please follow the URL given in below.

http://www.theautomatedtester.co.uk/tutorials/selenium/selenium_rc_setup.htm




On Oct 5, 10:53 pm, Nicolas Dermine <nicolas.derm...@gmail.com> wrote:
> Hi,
>
> Could you describe how you start the selenium server?
>
> Nico
>
> On 5 Oct 2011 18:56, "dimuthu" <dlbs...@gmail.com> wrote:> I'm using wamp, PHPUnit and selenium RC server. While running a simple

Nicolas Dermine

unread,
Oct 6, 2011, 6:19:57 AM10/6/11
to seleniu...@googlegroups.com
Hi dimuthu,

I thought maybe you did not launch the selenium server correctly
before running the phpunit test.

Does it output something that seems correct, such as :

C:\install\selenium-remote-control-1.0.3\selenium-server-1.0.3>java
-jar selenium-server.jar
12:12:06.625 INFO - Java: Sun Microsystems Inc. 19.0-b09
12:12:06.625 INFO - OS: Windows 7 6.1 amd64
12:12:06.641 INFO - v2.0 [a2], with Core v2.0 [a2]
12:12:06.750 INFO - RemoteWebDriver instances should connect to:
http://127.0.0.1:4444/wd/hub
12:12:06.750 INFO - Version Jetty/5.1.x
12:12:06.766 INFO - Started
HttpContext[/selenium-server/driver,/selenium-server/driver]
12:12:06.766 INFO - Started HttpContext[/selenium-server,/selenium-server]
12:12:06.766 INFO - Started HttpContext[/,/]
12:12:06.844 INFO - Started
org.openqa.jetty.jetty.servlet.ServletHandler@3ed02b51
12:12:06.844 INFO - Started HttpContext[/wd,/wd]
12:12:06.859 INFO - Started SocketListener on 0.0.0.0:4444
12:12:06.859 INFO - Started org.openqa.jetty.jetty.Server@43256ea2

I tried your code on my machine and it does open the facebook page.

sorry if it does not help,
nico

dimuthu

unread,
Oct 6, 2011, 6:36:09 AM10/6/11
to Selenium Users
Hi Nico,

I solved the issue. Now I'm trying to automate a popup php calender
using selenium RC. I'm stuck on it. Didn't find a suitable test case
written in php still. I don't know how to write the php script for it.
The problem is I cannot recognize anything in the calender using
firebug, its a popup calender and I can only select a date to fill a
text area given in the site. If you can please give me an idea for
this.

Thanks

Dimuthu.
> >http://www.theautomatedtester.co.uk/tutorials/selenium/selenium_rc_se...

Nicolas Dermine

unread,
Oct 6, 2011, 12:11:36 PM10/6/11
to seleniu...@googlegroups.com
Hi Dimuthu,

if you give more information about that calendar component (html
snippet, maybe some javascript if relevant), it will be easier for
someone on the list to have an idea,

good luck,
nico

dimuthu

unread,
Oct 6, 2011, 10:26:33 PM10/6/11
to Selenium Users
Hi Nico,

That popup calender written by php. That's what I only know.

Thanks,
Dimuthu.

Emilie

unread,
May 4, 2015, 8:06:39 PM5/4/15
to seleniu...@googlegroups.com, dlb...@gmail.com
Hello Dimuthu,

How did you solve your first issue ("Could not connect to the Selenium Rc Server")  ? I have the same problem and I don't know how to solve it.

Thanks
Reply all
Reply to author
Forward
0 new messages