Menu

HttpCommandProcessor generates error

Theo Moore
2009-01-14
2013-05-14
  • Theo Moore

    Theo Moore - 2009-01-14

    Not a lot of traffic in this forum, so I am not sure I'll get any feedback...but here goes.

    I am trying to use LoggingSelenium in conjunction with Selenium RC. At first, I thought the issue is with LoggingSelenium, but I am pretty sure I've proved to myself that isn't necessarily the case. I wondered if anyone else has seen anything similar. Based on where the stack trace indicates the "wedge", I don't think it's LoggingSelenium's issue. I most certainly could be wrong about that (and therefore I am in the wrong place...please forgive me if this is so).

    LoggingSelenium uses the HttpCommandProcessor to do it's work, but when it attempts to start selenium, the following is returned:

    java.lang.RuntimeException: Could not start Selenium session: ERROR: Threw an exception: 'window.top.Selenium.coreVersion' is null or not an object
        at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
        at aebn.testing.research.LogSelExp.setUp(LogSelExp.java:52)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
        at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
        at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
        at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
        at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
        at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
        at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
        at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
        at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: 'window.top.Selenium.coreVersion' is null or not an object
        at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
        at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
        at com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.java:262)
        at com.unitedinternet.portal.selenium.utils.logging.LoggingCommandProcessor.logExecutionEnvironment(LoggingCommandProcessor.java:322)
        at com.unitedinternet.portal.selenium.utils.logging.LoggingCommandProcessor.start(LoggingCommandProcessor.java:252)
        at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:81)
        ... 21 more

    Here's a snippet of what caused the wedge:

    final String resultHtmlFileName = "C:\\TheoStuff\\result.html";
    final String resultEncoding = "UTF-8";
    loggingWriter = LoggingUtils.createWriter(resultHtmlFileName, resultEncoding, true);

    LoggingResultsFormatter htmlFormatter = new HtmlResultFormatter(loggingWriter, resultEncoding);
    htmlFormatter.setScreenShotBaseUri("C:\\TheoStuff"); // this is for linking to the screenshots
    htmlFormatter.setAutomaticScreenshotPath("C:\\TheoStuff");

    LoggingCommandProcessor myProcessor = new LoggingCommandProcessor(new HttpCommandProcessor("localhost", 4444, "*iexplore", "http://theater.aebn.net"), htmlFormatter);
    selenium = new LoggingDefaultSelenium(myProcessor);

    //Start causes the wedge.
    selenium.start();

    I can instantiate selenium in the normal way, but not using the HttpCommandProcessor. I have also created a brand new project to get at the HttpCommandProcessor and it works fine, but one thing I note is that in order for it work correctly, the object reference has to be static. 

    Anyone seen this or have any familiarity with it?

    Thanks in advance,

    Theo

     
    • Robert Zimmermann

      This an interesting one.
      But is is an LoggingSelenium Issue.

      Cause:
      LogginSelenium tries to query the current Versions of Selenium-Core and -RemoteControl for reporting purpose.
      The DOM Element in Selenium-Core seems to be missing for You.

      Which Version of Remote-Control are You using?

      I'll work out an Fix. But this could last a couple of days.

      Robert

       
    • Theo Moore

      Theo Moore - 2009-01-14

      Sorry! I totally meant to include the RC build I am using. My mistake.

      I have gotten the same result with:

      selenium-remote-control-1.0-20090112.213013-38-dist
      selenium-remote-control-1.0-20081227.071532-21-dist

      Happy to provide whatever additional I can.

      Theo

       
    • Robert Zimmermann

      I have comitted an fix to svn.
      A release should be ready in a couple of days.

       
    • Theo Moore

      Theo Moore - 2009-01-15

      Excellent! Thanks a bunch. :-)

      Theo

       
    • Robert Zimmermann

      release 1.2 is no ready for download.
      please let me know if it now works for you

       
    • Theo Moore

      Theo Moore - 2009-01-15

      I'll drag it down and try it tomorrow first thing. Thanks for your help.

      Theo

       
    • Theo Moore

      Theo Moore - 2009-01-15

      Actually, I had a few minutes today, and it appears to be working perfectly now. Thanks again!

      Theo

       

Log in to post a comment.