Issue Details (XML | Word | Printable)

Key: SRC-678
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Sasha
Votes: 2
Watchers: 5
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

Proxy injection mode is not working

Created: 09/Jun/09 08:11 AM   Updated: 08/Mar/10 06:35 PM
Component/s: Client Driver - Java, Client Driver - Perl
Affects Version/s: 1.0 beta 2, 1.0
Fix Version/s: None

File Attachments: 1. Java Source File SeleniumTest0.java (0.3 kB) 09/Jun/09 08:11 AM - Sasha

Environment:
Tested with Java and perl clients, on Windows and Linux, with Firefox and Opera with at least the following URLs: www.google.co.il, www.tau.ac.il, www.ca.com


 Description  « Hide

With proxy injection mode enabled selenium.waitForPageToLoad("30000") times out and the following exception is generated

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR Server Exception: timed out waiting for window '' to appear
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91)
at com.thoughtworks.selenium.DefaultSelenium.waitForPageToLoad(DefaultSelenium.java:635)
at SeleniumTest0.main(SeleniumTest0.java:10)

See attached sample code - it works ok in normal mode and generates an exception in proxy injection mode



Sort Order: Ascending order - Click to sort in descending order
Sasha added a comment - 09/Jun/09 09:32 AM

Correction, it does not happen with Opera on windows.


Alexander Leibzon added a comment - 10/Jun/09 08:59 AM

Addition log from selenium-server :

16:38:20.461 INFO - Command request: waitForPageToLoad[30000, ] on session befa3355d3df4c96b80db657aa7bf4b7
16:38:52.043 ERROR - Exception running 'waitForPageToLoad 'command on session befa3355d3df4c96b80db657aa7bf4b7
org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'selenium_main_app_window' to appear
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:567)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:524)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:533)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.doCommand(FrameGroupCommandQueueSet.java:354)
at org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:35)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:547)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:365)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:126)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
16:38:52.074 INFO - Got result: ERROR Server Exception: timed out waiting for window 'selenium_main_app_window' to appear on session befa3355d3df4c96b80db657
16:38:52.106 INFO - Command request: close[, ] on session befa3355d3df4c96b80db657aa7bf4b7

I suspect it happens because proxyInjectionMode adds another Frame , and the waitForLoad() method confuses this Frame with actual pages frames.


MattFromHuddle added a comment - 22/Jul/09 05:41 AM

We're having the same problem. Tried with the latest snapshot version as well and got the same problem. Using Selenium-RC with .NET.

11:39:03.533 INFO - Java: Sun Microsystems Inc. 14.0-b16
11:39:03.533 INFO - OS: Windows 2003 5.2 x86
11:39:03.549 INFO - v1.0.2-SNAPSHOT [2704], with Core v@VERSION@ [@REVISION@]
11:39:03.549 INFO - The selenium server will execute in proxyInjection mode.
11:39:03.611 INFO - Version Jetty/5.1.x
11:39:03.611 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
11:39:03.611 INFO - Started HttpContext[/selenium-server,/selenium-server]
11:39:03.611 INFO - Started HttpContext[/,/]
11:39:03.627 INFO - Started SocketListener on 0.0.0.0:4444
11:39:03.627 INFO - Started org.mortbay.jetty.Server@ef22f8
11:39:08.674 INFO - Checking Resource aliases
11:39:08.689 INFO - Command request: getNewBrowserSession[*pifirefox, http://removed, ] on session null
11:39:08.705 INFO - creating new remote session
11:39:08.814 INFO - Allocated session 69527c59d3964f5c90ea699316bff403 for http://removed, launching...
11:39:08.846 INFO - Preparing Firefox profile...
11:39:11.814 INFO - Launching Firefox...
11:39:13.502 INFO - Got result: OK,69527c59d3964f5c90ea699316bff403 on session 69527c59d3964f5c90ea699316bff403
11:39:13.517 INFO - Command request: windowMaximize[, ] on session 69527c59d3964f5c90ea699316bff403
11:39:13.564 INFO - Got result: OK on session 69527c59d3964f5c90ea699316bff403
11:39:13.580 INFO - Command request: open[/, ] on session 69527c59d3964f5c90ea699316bff403
11:39:14.721 INFO - Started SocketListener on 0.0.0.0:41681
11:39:15.064 INFO - Started SocketListener on 0.0.0.0:41734
11:39:16.392 INFO - Started SocketListener on 0.0.0.0:41768
11:39:16.674 INFO - Got result: OK on session 69527c59d3964f5c90ea699316bff403
11:39:16.674 INFO - Command request: waitForPageToLoad[5000, ] on session 69527c59d3964f5c90ea699316bff403
11:39:22.674 ERROR - Exception running 'waitForPageToLoad 'command on session 69527c59d3964f5c90ea699316bff403
org.openqa.selenium.server.RemoteCommandException: timed out waiting for window '' to appear
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:567)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:524)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:533)
at org.openqa.selenium.server.FrameGroupCommandQueueSet.doCommand(FrameGroupCommandQueueSet.java:354)
at org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:35)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:549)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:364)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:125)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
11:39:23.143 INFO - Got result: ERROR Server Exception: timed out waiting for window '' to appear on session 69527c59d3964f5c90ea699316bff403


Rick Zhong added a comment - 03/Mar/10 08:24 PM

Date: Mar-3-2010
same error happens to all selenium-server.jar(1.0.1 - 2.0a2), when I run following in ASP.NET:

"java -jar selenium-server.jar -proxyInjectionMode -userContentTransformation old_test.js new_test.js"
_selenium = new DefaultSelenium("localhost", 4444, "*piiexplore", "http://testURL:8082")

which I found 1.0.1 is the ONLY version capable to finish my unit test!(but such error msg. are still annoying) all other version simply exit before being able to act as a proxy.

Please help!
-Rick

ERROR:
[
18:14:40.793 WARN - POST http://testurl:8082/selenium-server/driver/?seleniumStart=true&localFrameAddress=top&se
leniumWindowName=&uniqueId=sel_18431&sessionId=27d5c216bbbb42cca024bd5f72d3e7cd&counterToMakeURsUniqueAndSoStopPageCachi
ngInTheBrowser=1267668880801&sequenceNumber=264977 HTTP/1.1
java.lang.RuntimeException: sessionId 27d5c216bbbb42cca024bd5f72d3e7cd doesn't exist; perhaps this session was already s
topped?
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:218)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleBrowserResponse(SeleniumDriverResourceHandler.
java:159)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:127)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
]


Jennifer Bevan added a comment - 08/Mar/10 04:51 PM

I don't think that last one is strictly *piiexplore mode – with the latest IE8, on both Win7 and WinXP, I can get that last error to happen just by running a series of IE / HTA-mode tests and waiting for a bit. I haven't yet seen it in IE7, at least not within the same time frame.

Here's the scenario: I have a 'hello world' test that uses the (default) *iexplore mode which launches the test in multiwindow mode, with IE in HTA mode. I have not yet tried to use a series of tests with *iexploreproxy.

After 1-10 tests, the application window 'hello world' is not killed. No worries, RC doesn't seem to mind (although I'm rather unhappy about the browser window being open; what if there were temporary internet files associated with it that need to be removed?) and it keeps going. After about 5-25 more tests (each of these are sequential and a few minutes apart for ease of viewing) then the RC Remote Control window is the one that doesn't get killed although the associated 'hello world' window does – note that the first 'hello world' window is still there from the first problem.

At that point, the command history shows 'getTitle()', which is the last selenium command executed before testComplete. Something is POSTing to the RC server (the RC control window?) for a really long period of time – as I type I'm only up to sequenceNumber 584, whereas the previous poster made it up to 264977. Sometimes, if I let this go on long enough, my winXP machine tells me it's rebooting because of ...well, I don't have a screenshot of that right now. Anyway, that of course 'fixes' the problem, until the next time I run the sequence.

During this error state, if I then run various other tests (*iexploreproxy), they do pass. Until the machine can no longer start IE up fast enough, that is to say.

Interestingly enough, once one of each type of window is left hanging open (control window or the 'hello world' window, the rate of abandoned windows drops quickly. It's been running now for 30 minutes and still just those two windows are there. There's a very good chance that the probability of hitting whatever race condition causes this drops quite a bit once the incessant POSTing start happening.

I haven't checked in a while to see if *iexplore is actually now the same thing as *piiexplore, in which case this may be the same problem as initially reported. Otherwise, this may need to be made into a new bug.


Jennifer Bevan added a comment - 08/Mar/10 06:25 PM

Ah, yes. It's when I send a shutDown() command to the flailing RC server that it reboots my machine. Note that I can kill the cmd window no problem - it's specifically when I call shutDown and then kill all the remaining iexplore tasks and it's been looping with the above errors. This could very well be a windows issue, but the fact remains that the windows cleanup sequence still needs some work.

-Jen


Jennifer Bevan added a comment - 08/Mar/10 06:35 PM

Update: I only see the looping POST warning above with IE8 – not with IE7. IE7 also has the same problem closing the windows, but does not result in anything continuing to send POSTS to the RC server.

-Jen