Hi,
I'm trying to run Selenium using the java driven api using jetty 5.1.4. Here's my code, which I lifted from
http://www.paulhammant.com/ (it's more helpful that the driven docs).
public void run(){
String codeRoot = "c:/cyrusinnovation/dev/myWebapp";
Selenium selenium = new DefaultSelenium(new JettyCommandProcessor(new File(codeRoot), DefaultSelenium.DEFAULT_SELENIUM_CONTEXT,
new DirectoryStaticContentHandler(new File(codeRoot, "selenium"))),
new SystemDefaultBrowserLauncher());
selenium.start();
selenium.open("/");
selenium.verifyTextPresent("Hello world");
new DirectoryStaticContentHandler(new File(codeRoot, "selenium"))),
new SystemDefaultBrowserLauncher());
selenium.start();
selenium.open("/");
selenium.verifyTextPresent("Hello world");
}
Unfortunately, I end up with this stack trace on the open command (after about 25 seconds, of course). The weird part is, the browser opens with the
http://localhost:8080/selenium-driver/SeleneseRunner.html, and I see my page get opened. But I guess that the driven code is not getting a response from Jetty?
com.thoughtworks.selenium.SeleniumCommandTimedOutException
at com.thoughtworks.selenium.SingleEntryAsyncQueue.get(SingleEntryAsyncQueue.java:37)
at com.thoughtworks.selenium.SeleneseQueue.doCommand (SeleneseQueue.java:32)
at com.thoughtworks.selenium.embedded.jetty.SeleneseJettyResourceHandler.doCommand(SeleneseJettyResourceHandler.java:45)
at com.thoughtworks.selenium.embedded.jetty.JettyCommandProcessor.doCommand (JettyCommandProcessor.java:97)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:55)
at com.thoughtworks.selenium.SingleEntryAsyncQueue.get(SingleEntryAsyncQueue.java:37)
at com.thoughtworks.selenium.SeleneseQueue.doCommand (SeleneseQueue.java:32)
at com.thoughtworks.selenium.embedded.jetty.SeleneseJettyResourceHandler.doCommand(SeleneseJettyResourceHandler.java:45)
at com.thoughtworks.selenium.embedded.jetty.JettyCommandProcessor.doCommand (JettyCommandProcessor.java:97)
at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:55)
So then I rolled back to the version of Jetty that came with the selenium dist (jetty 4.2.9)
Now when I run it, I get a problem with Commons Logging (1.0.4). I'm guessing my log4j is getting loaded by my test codes classloader and jetty's classloader. Has anyone else run into that?
java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java
:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:176) at org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:215) at org.mortbay.jetty.servlet.ServletHandler.initializeServlets (ServletHandler.java:436) at org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150) at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:442) at org.mortbay.http.HttpServer.start (HttpServer.java:647) at com.thoughtworks.selenium.embedded.jetty.JettyCommandProcessor.start(JettyCommandProcessor.java:102) at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:287) at com.pureform.moover.fit.block.BlockEditorFixture.startTomcat (BlockEditorFixture.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at fit.MethodTarget.invoke(MethodTarget.java:95) at fit.MethodTarget.invoke(MethodTarget.java:106) at fit.MethodTarget.invokeAndWrap (MethodTarget.java:231) at fit.DoFixture.interpretCells(DoFixture.java:244) at fit.FlowFixture.interpretTable(FlowFixture.java:35) at fit.FlowFixture.interpretTables(FlowFixture.java:24) at fit.Fixture.doTables(Fixture.java :58) at fit.runner.HtmlRunner.runTable(HtmlRunner.java:59) at fit.runner.HtmlRunner.runInSuite(HtmlRunner.java:39) at fit.runner.FolderRunner.runFile(FolderRunner.java:161) at fit.runner.FolderRunner.runDiry(FolderRunner.java :136) at fit.runner.FolderRunner.runDiry(FolderRunner.java:132) at fit.runner.FolderRunner.runDiry(FolderRunner.java:132) at fit.runner.FolderRunner.run(FolderRunner.java:104) at fit.runner.FolderRunner.run(FolderRunner.java :205) at fit.runner.FolderRunner.main(FolderRunner.java:49) Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException : Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of ' org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of ' org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log ' visible, which is not allowed.)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance (LogFactoryImpl.java:209) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351) at org.apache.jasper.servlet.JspServlet.(JspServlet.java:57) ... 35 more Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:397) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529) ... 39 more Caused by: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. at org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:385) ... 40 more
--
Rex Madden
Director of Technology
Cyrus Innovation
IT Consulting and Agile Software Development
New York City, New York
http://www.cyrusinnovation.com
[EMAIL PROTECTED]
_______________________________________________ Selenium-users mailing list [EMAIL PROTECTED] http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
