views:

1011

answers:

2

Hi,

I'm having some trouble running a simple selenium test through Hudson.

I've installed the SeleniumHQ plugin for Hudson and configured a job to run a simple test suite which consists of two tests which run fine from the Selenium IDE and from the TestNG plugin in Eclipse.

However, when I try to run them through Hudson, the testing just seems to stall at the end of the first test (regardless of which test it is, I've tried many different ones which are all valid when ran in other enviornments).

The Console Output from Hudson reads as follows:

11:48:09.543 INFO - Java: Sun Microsystems Inc. 14.2-b01
11:48:09.544 INFO - OS: Windows Vista 6.0 x86
11:48:09.559 INFO - v1.0.1 [2696], with Core v@VERSION@ [@REVISION@]
11:48:09.655 INFO - Version Jetty/5.1.x
11:48:09.656 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:48:09.657 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:48:09.657 INFO - Started HttpContext[/,/]
11:48:09.670 INFO - Started SocketListener on 0.0.0.0:4444
11:48:09.670 INFO - Started org.mortbay.jetty.Server@c40c80
11:48:09.825 INFO - Preparing Firefox profile...
11:48:12.046 INFO - Launching Firefox...
11:48:12.919 INFO - Checking Resource aliases

The strange thing is, I can see the first test being ran, and it passes but selenium then doesnt skip onto the next one, and if I create a test suite with just the one test, it simply hangs there indefinitely. Please note that I have an AssertVisible action in the test to check the validity of the results. Do I need to return anything else for Hudson to run the test properly?

Thanks in advance for any help on this...

A: 

Could you check if the command line stated by the SeleniumHQ plugin is correct?

  1. In a command window, paste the command and run it
  2. Check if the test start, execute and end normally
  3. Check the result file
Pascal Thivent
Yep, I tried doing that already but it has the exact same result - the first test will run, pass and then nothing.Additionally, there is no result file outputted.
Gearóid
Ok (it's actually good to have the same behavior). Does it really hang indefinitely? Can you try with one test only?
Pascal Thivent
I've tested it with a test suite that consists of one test (a simple login then logout test) and its been hanging 15 minutes....
Gearóid
So you see the test being run but you never get `INFO - Shutting down...` That's it?
Pascal Thivent
Actually, after 30 minutes I get the following:HTML suite exception seen:org.openqa.selenium.server.SeleniumCommandTimedOutException at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:138) at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:174) at org.openqa.selenium.server.SeleniumServer.runHtmlSuite(SeleniumServer.java:524) at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:232) at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:188)Any ideas?
Gearóid
It appears that 30mn is the default timeout http://wiki.openqa.org/display/SRC/Selenium+RC+command+line+parameter+notes It might be interesting to lower it for testing purpose. Nevertheless, it would be interesting to update the question with this trace.
Pascal Thivent
BTW, is there anything interesting in `selenium.log`? Could you try to replace firefox by iexplorer?
Pascal Thivent
Interestingly, the test runs fine in IE! I've tried it in Opera and it has the same effect as FF - test runs to the end and then stalls.Any ideas on why this is happening Pascal? Thanks so much for your help on this btw....
Gearóid
I was expecting this answer. Actually several persons are facing differences of behavior between ie and firefox (and opera, chrome, safari...), e.g. http://clearspace.openqa.org/thread/19845?tstart=0, http://clearspace.openqa.org/message/65751, etc. The first link seems close to your issue. Sadly, there is no answer in the thread... A few more hints: did you read http://clearspace.openqa.org/thread/13928? are you using a proxy? are you using a custom profile? is using firefox 2 an option? Keep me updated.
Pascal Thivent
A: 

I've had this problem. You can get around it by installing compatible versions of selenium and firefox. See if they work together outside Hudson.

Ric