0
votes

This is the error I'm getting when I try to run my selenium script through a build.xml on a network server:

@BeforeTest Setup

java.lang.RuntimeException: Could not start Selenium session: Internal Server Error   
 at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)   
 at com.doubleclick.richmedia.selenium.InpageEndToEnd.createSeleniumClient(InpageEndToEnd.java:34)   
 at com.doubleclick.richmedia.selenium.InpageEndToEnd.setUp(InpageEndToEnd.java:27)   
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)   
Caused by: com.thoughtworks.selenium.SeleniumException: Internal Server Error   
 at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)   
 at com.thoughtworks.selenium.HttpCommandProcessor.getCommandResponseAsString(HttpCommandProcessor.java:168)   
 at com.thoughtworks.selenium.HttpCommandProcessor.executeCommandOnServlet(HttpCommandProcessor.java:104)   
 at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:86)   
 at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)   
 at com.thoughtworks.selenium.HttpCommandProcessor.start(HttpCommandProcessor.java:223)   
 at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81)   
... 26 more   
 ... Removed 23 stack frames 

And here's my @BeforeTest script:

@BeforeTest

public void setUp() throws Exception {<br>
createSeleniumClient("http://www.google.com");<br>
}

protected DefaultSelenium createSeleniumClient(String url) throws Exception {
    selenium =  new DefaultSelenium("localhost", 4444, "*firefox", url);
    selenium.start();
    selenium.setSpeed("2000");
    selenium.deleteAllVisibleCookies();
    return selenium;
}

Am I doing something wrong here? I was able to run this locally through IntelliJ. Thanks.

3

3 Answers

0
votes

This may sound like a strange question, but are you really passing "url" literally in

createSeleniumClient("url");

"url" is no valid url and so I'd expect Selenium to complain here.

0
votes

Have you made sure that you have both the Selenium server jar and the java client jar from the same version? I accidentally had server version 0.9.2 and client jar 1 beta and was getting this error. Making sure I was compiling with the 0.9.2 client jar fixed the issue for me.

0
votes

Have you verified that the network server that you're trying to execute the tests on is running the Selenium Server? The error looks like the RC code is having trouble connecting to the server to start the tests...

I'd suggest trying to execute the tests manually on the build machine at first in order to ensure that everything is configured properly.