Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Selenium RC throws a _102 error

    We are using SmartGWT 2.2 and trying to perform our GUI testing with Selenium RC 2.0. We have come across a problem with waitForCondition command in Firefox 3.6.7.

    We started selenium server w/ the user-extension.js provided by the SmartGWT distribution. Whenever a waitForCondition() is called, the server returns a "_102 is undefined" error. Here is a section of the selenium server log:

    Code:
    09:56:19.619 INFO [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - Command request: waitForCondition[selenium.isElementPresent("scLocator=//TreeGrid[ID=\"LocatableTreeGrid_Groups\"]/body/row[0]/col[fieldName=nodeTitle||0]");, 3000] on session 010aeeeda6d54a1d91d1a11d301ccdd1
    09:56:19.619 DEBUG [12] org.openqa.selenium.server.commands.SeleniumCoreCommand - Executing 'waitForCondition' selenium core command on session 010aeeeda6d54a1d91d1a11d301ccdd1
    09:56:19.619 DEBUG [12] org.openqa.selenium.server.commands.SeleniumCoreCommand - Session 010aeeeda6d54a1d91d1a11d301ccdd1 going to doCommand(waitForCondition,selenium.isElementPresent("scLocator=//TreeGrid[ID=\"LocatableTreeGrid_Groups\"]/body/row[0]/col[fieldName=nodeTitle||0]");,3000)
    09:56:19.619 DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - ---------retrieving CommandQueue for sel_60764
    09:56:19.623 DEBUG [12] org.openqa.selenium.server.CommandHolder - 	sel_60764 commandHolder sel_60764 getCommand() 
    09:56:19.623 DEBUG [12] org.openqa.selenium.server.SingleEntryAsyncQueue - putting command: json={command:"waitForCondition",target:"selenium.isElementPresent(\"scLocator=//TreeGrid[ID=\\\"LocatableTreeGrid_Groups\\\"]/body/row[0]/col[fieldName=nodeTitle||0]\");",value:"3000"}
    09:56:19.623 DEBUG [12] org.openqa.selenium.server.SingleEntryAsyncQueue - ..command put?: true
    09:56:19.623 DEBUG [18] org.openqa.selenium.server.SingleEntryAsyncQueue - data from polling: json={command:"waitForCondition",target:"selenium.isElementPresent(\"scLocator=//TreeGrid[ID=\\\"LocatableTreeGrid_Groups\\\"]/body/row[0]/col[fieldName=nodeTitle||0]\");",value:"3000"}
    09:56:19.623 DEBUG [12] org.openqa.selenium.server.CommandResultHolder - 	sel_60764 commandResultHolder sel_60764 getResult() called
    09:56:19.624 DEBUG [12] org.openqa.selenium.server.SingleEntryAsyncQueue - waiting for data for at most 1800 more s
    09:56:19.624 DEBUG [18] org.openqa.selenium.server.CommandHolder - 	sel_60764 commandHolder sel_60764 getCommand() -> json={command:"waitForCondition",target:"selenium.isElementPresent(\"scLocator=//TreeGrid[ID=\\\"LocatableTreeGrid_Groups\\\"]/body/row[0]/col[fieldName=nodeTitle||0]\");",value:"3000"}
    09:56:19.624 DEBUG [18] org.openqa.selenium.server.SeleniumDriverResourceHandler - res to sel_60764: json={command:"waitForCondition",target:"selenium.isElementPresent(\"scLocator=//TreeGrid[ID=\\\"LocatableTreeGrid_Groups\\\"]/body/row[0]/col[fieldName=nodeTitle||0]\");",value:"3000"}
    09:56:19.624 DEBUG [18] org.openqa.jetty.http.HttpContext - Handled by org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.624 DEBUG [18] org.openqa.jetty.http.HttpConnection - RESPONSE:
    HTTP/1.1 200 OK
    Date: Fri, 01 Oct 2010 13:56:19 GMT
    Server: Jetty/5.1.x (Linux/2.6.34.6-47.fc13.x86_64 amd64 java/1.6.0_18
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    Content-Type: text/plain
    Content-Length: 1185
    
    
    09:56:19.880 DEBUG [13] org.openqa.jetty.http.HttpConnection - REQUEST from SocketListener0@0.0.0.0:4444:
    POST /selenium-server/driver/?&localFrameAddress=top&seleniumWindowName=&uniqueId=sel_60764&sessionId=010aeeeda6d54a1d91d1a11d301ccdd1&counterToMakeURsUniqueAndSoStopPageCachingInTheBrowser=1285941379879&sequenceNumber=25 HTTP/1.1
    Host: localhost:4444
    User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100723 Fedora/3.6.7-1.fc13 Firefox/3.6.7
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    keep-alive: 115
    Connection: keep-alive
    Content-Length: 32
    Content-Type: text/plain; charset=UTF-8
    Pragma: no-cache
    Cache-Control: no-cache
    
    
    09:56:19.880 DEBUG [13] org.openqa.jetty.http.HttpServer - Try HttpContext[/selenium-server/driver,/selenium-server/driver],0
    09:56:19.880 DEBUG [13] org.openqa.jetty.http.HttpServer - Try HttpContext[/selenium-server,/selenium-server],0
    09:56:19.880 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.jetty.http.handler.SecurityHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.880 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.StaticContentHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.881 DEBUG [13] org.openqa.jetty.http.handler.ResourceHandler - PATH=/driver/ RESOURCE=file:/opt/selenium-2.0a5/MISSING%20RESOURCE
    09:56:19.881 DEBUG [13] org.openqa.jetty.http.handler.ResourceHandler - Looking for file:/opt/selenium-2.0a5/MISSING%20RESOURCE
    09:56:19.881 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.SessionExtensionJsHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.882 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.htmlrunner.SingleTestSuiteResourceHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.882 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.htmlrunner.SeleniumHTMLRunnerResultsHandler@74341960
    09:56:19.882 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.CachedContentTestHandler@7854a328
    09:56:19.882 DEBUG [13] org.openqa.jetty.http.HttpContext - Handler org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.882 DEBUG [13] org.openqa.selenium.server.SeleniumDriverResourceHandler - req: POST /selenium-server/driver/?&localFrameAddress=top&seleniumWindowName=&uniqueId=sel_60764&sessionId=010aeeeda6d54a1d91d1a11d301ccdd1&counterToMakeURsUniqueAndSoStopPageCachingInTheBrowser=1285941379879&sequenceNumber=25 HTTP/1.1
    Host: localhost:4444
    User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.7) Gecko/20100723 Fedora/3.6.7-1.fc13 Firefox/3.6.7
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    keep-alive: 115
    Connection: keep-alive
    Content-Length: 32
    Content-Type: text/plain; charset=UTF-8
    Pragma: no-cache
    Cache-Control: no-cache
    
    
    09:56:19.882 DEBUG [13] org.openqa.selenium.server.FrameGroupCommandQueueSet - ---------retrieving CommandQueue for sel_60764
    09:56:19.882 DEBUG [13] org.openqa.selenium.server.SeleniumDriverResourceHandler - Browser 010aeeeda6d54a1d91d1a11d301ccdd1/:top sel_60764 posted _102 is undefined
    09:56:19.882 DEBUG [13] org.openqa.selenium.server.FrameGroupCommandQueueSet - ---------retrieving CommandQueue for sel_60764
    09:56:19.883 DEBUG [13] org.openqa.selenium.server.SingleEntryAsyncQueue - putting command: _102 is undefined
    09:56:19.883 DEBUG [13] org.openqa.selenium.server.SingleEntryAsyncQueue - ..command put?: true
    09:56:19.883 DEBUG [12] org.openqa.selenium.server.SingleEntryAsyncQueue - data from polling: _102 is undefined
    09:56:19.883 DEBUG [13] org.openqa.selenium.server.CommandHolder - 	sel_60764 commandHolder sel_60764 getCommand() called
    09:56:19.883 DEBUG [12] org.openqa.selenium.server.CommandResultHolder - 	sel_60764 commandResultHolder sel_60764 getResult() -> _102 is undefined
    09:56:19.883 DEBUG [13] org.openqa.selenium.server.SingleEntryAsyncQueue - waiting for data for at most 10 more s
    09:56:19.883 DEBUG [12] org.openqa.selenium.server.commands.SeleniumCoreCommand - Got result: _102 is undefined on session 010aeeeda6d54a1d91d1a11d301ccdd1
    09:56:19.883 INFO [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - Got result: _102 is undefined on session 010aeeeda6d54a1d91d1a11d301ccdd1
    09:56:19.883 DEBUG [12] org.openqa.jetty.http.HttpContext - Handled by org.openqa.selenium.server.SeleniumDriverResourceHandler in HttpContext[/selenium-server,/selenium-server]
    09:56:19.884 DEBUG [12] org.openqa.jetty.http.HttpConnection - RESPONSE:
    HTTP/1.1 200 OK
    Date: Fri, 01 Oct 2010 13:56:19 GMT
    Server: Jetty/5.1.x (Linux/2.6.34.6-47.fc13.x86_64 amd64 java/1.6.0_18
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: Thu, 01 Jan 1970 00:00:00 GMT
    Content-Type: text/plain
    Content-Length: 17
    Does anyone have any idea on what's happening and how to solve this?

    Thanks

    #2
    It seems what is roughly happening here is that Selenium starts polling to see if the element is present and the condition is satisfied. But that perhaps smartgwt isn't quite ready for the query and the processing of the locator is generating a fault.

    _102 is a variable in the obfuscated ISC_Core.js which is in the smartgwt 2.2 jar. After some experimentation I was able to avoid the issue by adding some null protection in the javascript. Specifically, changing:

    Code:
    if(_102.$29p())return null;
    To:

    Code:
    if(_102 == null || _102.$29p())return null;
    This has not had any obvious downside so far, and forces Selenium to keep polling.

    I checked the nightly smartgwt build and this problem still occurred. I would recommend that an equivalent fix be made for the next smartgwt release.

    Comment


      #3
      Thanks for the notification - we've added an equivalent fix to the source which should be present in the next nightly build.

      Comment


        #4
        Excellent, thank you, I'll try it out.

        Comment

        Working...
        X