views:

133

answers:

2

Hello!

I'm using Selenium RC in a Ubuntu system. I want to automate the tests, and I need to start Selenium-server.jar on startup of the machine.

I created seleniumServer.conf in /ect/init/ with:

start on startup
start on runlevel 3

respawn

exec xvfb-run java -jar /home/condde/selenium-server-1.0.3/selenium-server.jar -port 4444

When I reboot the machine, it works fine, the process is running. But when I execute a test, the result is:

PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

Any ideas? Thanks!

A: 

A server does start without errors?

alexey.chumagin
No errors.. The process is running, to verify ai used: ps -aux | grep java. However, when I start a test, it can't connect.
Check ports and address, please. I don`t work with Linux OS, but your problem is similar to something that is not properly specified port or address.
alexey.chumagin
Or port and adress of server dont match with port and adress of test
alexey.chumagin
Server on the remote machine?
alexey.chumagin
In the config file phpunit.yml, host: localhost, port: 4444. The default port used by selenium-server is port 4444. To make sure, I added -port 4444 to the exec line of seleniumServer.conf
I forgot to say... The server and the client are in the same machine.
show your test`s code, please
alexey.chumagin
Sorry. I couldn't lose more time with this. I also tried to use xvfb and set a display port.. whatever. As I use Hudson as continuous integration tool, I added a new shell script with 'xvfb-run java -jar /home/condde/selenium-server-1.0.3/selenium-server.jar' before the shell that executes the actual test. It is working fine! alexey.chumagin thanks for the help!
you are welcome .Close the question, please
alexey.chumagin
A: 

Use -debug to start Selenium with debug log to see if any error.

 java -jar selenium-server.jar -debug  > /var/log/selenium-server.log 2>&1
tszming