Selenium RC and LoggingSelenium

17 views
Skip to first unread message

Theo

unread,
Jan 13, 2009, 4:00:22 PM1/13/09
to selenium-users...@googlegroups.com
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. My next step is to try to get at the HttpCommandProcessor on my own (outside of LoggingSelenium) and prove it might be an issue with selenium itself.

Anyone seen this or have any familiarity with it?

Thanks in advance,
Theo

Theo

unread,
Jan 14, 2009, 8:37:18 AM1/14/09
to selenium-users...@googlegroups.com
As an update to my question, I tried to replicate the behaviour in C# htting the HttpCommandProcessor directly (not letting LoggingSelenium do it), and was able to instantiate it fine. I then tried a brand-new project in Java doing the same thing. It works also. It does appear to be a problem with how LoggingSelenium is using the object.

Theo

Theo

unread,
Jan 15, 2009, 8:57:42 AM1/15/09
to selenium-users...@googlegroups.com
Apparently this is a LoggingSelenium issue, and a fix is in progress. If you run into it, you can check [http://loggingselenium.sourceforge.net/]
for details.

Theo

Reply all
Reply to author
Forward
0 new messages