I am fairly new to RemoteWebDriverServer, Jetty and Servlet. Sorry if
this sounds really basic. I am using 2.0b2, jetty 6.1.22,jetty-
util-6.1.22. I am trying to configure the selenium server in the code
so that I can avoid the manual process of starting the selenium
server on the remote host. Here is what I have so far, basically copy
of the code from the RemoteWebDriverServer wiki [1]. When I start the
server locally, I get following message.
2011-06-03 10:30:55.312:INFO::Logging to STDERR via
org.mortbay.log.StdErrLog
2011-06-03 10:30:55.343:INFO::jetty-6.1.22
2011-06-03 10:30:55.577:INFO::NO JSP Support for , did not find
org.apache.jasper.servlet.JspServlet
2011-06-03 10:30:55.827:INFO::Started
SelectChann...@0.0.0.0:4444
If I set the remote host like below, I get bind exception.
public AppServer() throws Exception {
try {
WebAppContext context = new WebAppContext();
context.setContextPath("");
context.setWar(".");
server.addHandler(context);
context.addServlet(DriverServlet.class, "/wd/*");
SelectChannelConnector connector = new SelectChannelConnector();
connector.setHost("MyRemoteHostIPAddress");
connector.setPort(4444);
server.addConnector(connector);
server.start();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception{
new AppServer();
}
}
2011-06-03 10:32:26.747:WARN::failed
SelectChannelConnector@MyRemoteHostIPAddress:4444:
java.net.BindException: Cannot assign requested address: bind
So I thought the port might not be open or some other app may be using
this port. So I ran the above code "locally" on the "remote host" and
then ran my webdriver test on my "local machine" then I get following
exception. I did try different port numbers here but no success. If I
start the selenium server manually on the remote hosts, the webdriver
test on my local system works just fine.
java.lang.UnsupportedOperationException:
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:
131)
at
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:
105)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:
410)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:
104)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
87)
at
org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:
95)
Is there anything I am missing or doing incorrectly?
Thanks,
-Nilesh
[1]
http://code.google.com/p/selenium/wiki/RemoteWebDriverServer