History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-465
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Dave
Votes: 0
Watchers: 0
Operations

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

Exception thrown when calling selenium.start() when attempting to drive *iexplore

Created: 17/Apr/08 08:47 AM   Updated: 12/Aug/08 05:36 PM
Component/s: Client Driver - Python
Affects Version/s: 0.9.2
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File src-465.patch (1 kb)
2. Text File src-465b.patch (2 kb)

Environment: Windows XPSP2, Python 2.5


 Description  « Hide
I have only been able to reproduce this issue on Windows XP.

When I attempt to call selenium.start() I get the following expection:
File "C:\Python25\lib\site-packages\selenium.py", line 170, in start
raise Exception, result
Exception: 0eca522de08b4e17a88b7ef557b364f3


NOTE: 0eca522de08b4e17a88b7ef557b364f3 is the browser session id.

The code used to produce this issue:

from selenium import selenium
browser = selenium("localhost",4444,"*firefox","http://www.google.com")
browser.start()

"java -jar selenium-server.jar -interactive -multiWindow" is used to run the selenium server.

Note: IE does spawn on selenium.start().


 All   Comments   Work Log   Change History      Sort Order:
adam goucher - 17/Apr/08 03:19 PM
In your selenium.py file, change the existing start method to:

    def start(self):
        result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL])
        valid = False
        try:
            # jetty session id's are base 30 - 36, determined randomly
            # base 30 - 35 will convert properly as base 36
            long(result, 36)
        except ValueError:
            raise Exception, result
        else:
            self.sessionId = result

I suspect what has happened is that the version of jetty inside the server has changed and introduced a new way of generating sessionids. The current implementation assumes that result is going to be base10, but from what I can determine from the jetty source it is base30 - 36 (see http://kickjava.com/src/org/mortbay/jetty/servlet/AbstractSessionManager.java.htm).

That solved the problem for me today. Let me know if it works for you and I'll create a proper patch.

-adam

adam goucher - 20/Apr/08 10:10 PM
So the code I posted the otherdays will work, but for the wrong reasons. Here is a patch that works for the right ones.

The real reason for this that the selenium server uses a UUID scheme when creating session id's. A UUID is hex encoded so has 0-9 as well as a-f; the long without a radix assumes only 0-9. So instead of doing the cast to a long I create a python UUID object out of the UUID returned form the server. If the UUID is created then we keep the id otherwise we blow up thus mimicing the existing behavior.

adam goucher - 21/Apr/08 09:37 AM
Modified the patch to be jython aware.