Announcement

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

    [Selenium] getPageCoords is not a function on session XYZ

    SmartGWT 2.2, Firefox 3.6.8, Selenium-RC 1.0.3 (SmartClient 2.2 JavaScript extensions only)

    I'm trying to right click the first row in my application's ListGrid element using Selenium. I've used the Selenium-IDE (with the IDE extensions loaded) to record this portion of my workflow and am coming up with this:

    Code:
    selenium.contextMenu("scLocator=//ListGrid[ID=\"isc_ListGrid_1\"]/body/row[name=\"myImage\"||image=\"myImage.png\"||0]/col[fieldName=image||0]")
    Note I've replaced the "name" and "image" tag text with "myImage". The ID of "isc_ListGrid_1" is consistent between sessions, so that's not changing on me. The ordering of the rows and all elements is static as well.

    The exact error I'm receiving in the Selenium server log is this:
    INFO - Got result: ERROR: Command execution failure. Please search the forum at http://clearspace.openqa.org for error details from the log window. The error message is: autWindow.isc.AutoTest.getPageCoords is not a function on session cc9217c7890b46ab9e3d3648a6a12b9a

    I'm running the exact code that the Selenium-IDE generated using the SmartClient IDE extension and JavaScript extension. I have scoured the web for any information on this error and am stumped.

    Any thoughts? Thanks in advance!

    -Nathan

    #2
    Have you tried replaying the command from Selenium IDE? If so, are you seeing the same error message?

    Comment


      #3
      Thank you for that suggestion; it was a good idea. I have tried running it back using this generated code:

      Code:
      selenium.contextMenu("scLocator=//ListGrid[ID=\"isc_ListGrid_1\"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0]");
      through the IDE (during the same session) and these are the results:

      Code:
      # [info] Executing: |contextMenu | scLocator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0] | |
      # [debug] Command found, going to execute contextMenu
      # [info] Locator in doContextMenu : scLocator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0]
      # [debug] modifyWindow seleniumMarker1282311574405:selenium1282311574406
      # [debug] _getFrameElement: frameElement=null
      # [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1282311574406
      # [debug] modifyWindow seleniumMarker1282311574405:1
      # [debug] _getFrameElement: frameElement=[object XPCNativeWrapper [object HTMLIFrameElement]]
      # [debug] frameElement.name=
      # [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1282311574417
      # [debug] modifyWindow seleniumMarker1282311574405:1
      # [debug] _getFrameElement: frameElement=[object XPCNativeWrapper [object HTMLIFrameElement]]
      # [debug] frameElement.name=
      # [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1282311574433
      # [debug] getCurrentWindow newPageLoaded = false
      # [debug] Locate Element with SC Locator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0], inDocument=[object XPCNativeWrapper [object HTMLDocument]], inWindow=https://myURL/#myPage
      # [debug] Returning element :: null for SC locator //ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0]
      # [debug] Locate Element with SC Locator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0], inDocument=[object XPCNativeWrapper [object HTMLDocument]], inWindow=javascript:''
      # [debug] Returning element :: null for SC locator //ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0]
      # [debug] Locate Element with SC Locator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0], inDocument=[object XPCNativeWrapper [object HTMLDocument]], inWindow=https://myURL/1640C1352FC1AD030A53FF816AC315DF.cache.html
      # [debug] Returning element :: null for SC locator //ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0]
      
      # [error] Element scLocator=//ListGrid[ID="isc_ListGrid_1"]/body/row[name=myImage||image=myImage.png||0]/col[fieldName=image||0] not found
      One detail that may help: During the recording session, I am actually right-clicking on an image inside a ListGrid row. I have tried the same techniques right-clicking anywhere inside the desired row and am getting the same identification errors.

      Thanks in advance!

      -Nathan

      Comment


        #4
        Can anyone shed any light on this or point me in the direction to dig deeper? I feel as though I've traced this as far as I'm able and am up against a wall.

        Comment


          #5
          I was able to get around this issue by sending the following sequence:
          1) mouseDownRightAt("locator", "1,1");
          2) mouseUpRightAt("locator", "1,1");
          3) contextMenuAt("locator", "1,1");

          Using the approach I was able to get the context menu to trigger properly. A few notes:
          a) I could not get this to work without using the "At" version of these functions
          b) The coordinates "0,0" did not work for me in any situation. I had success with "1,1" and "1,2" for various elements, depending on how they render.
          c) While this approach is ugly, it is dynamic and programmatic. So you can continue to operate your mouse and click around while the script is running and it works.

          Hope this helps somebody with the same problem someday.

          Regards,
          Nathan

          Comment


            #6
            This has helped me today, so you got your wish almost exactly a year later.
            I have been looking for a solution to right clicking on a map on and off for a couple of weeks now, and this finally did it for me.
            Thanks you very much. :)

            Comment

            Working...
            X