Announcement

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

    getTable with selenium user extensions

    Hello,

    I'm having a problem with the getTable function when I have sc user extensions loaded.

    This is a part of the interface that doesn't use smartclient, so I expect it to work just as it does without the user extensions. But with the user extensions it fails.

    I don't really know how to explain this better. Perhaps with code...

    This:
    selenium.getTable(xpath=//table[@id='tableX'].0.2)

    without the user extensions returns the text of the cell in row 0, column 2.

    with user extensions returns an empty string and this warning is sent to console:
    WARNING: getString(getTable) saw a bad result OK

    As I'm not using a scLocator, selenium should be using orig_getTable. But it is clearly not working.

    Any suggestion?

    thanks.

    #2
    I tried the same scenario from the IDE with verifyTable and received this error:
    [error] Unexpected Exception: message -> listGrid.getCellValue is not a function, fileName -> chrome://selenium-ide/content/tools.js -> file:///home/elopio/installers/smartclient/SmartClient_SC_SNAPSHOT-2010-08-08/smartclientSDK/tools/selenium/user-extensions.js, lineNumber -> 243, stack -> ("xpath=//table[@id='undefined_table'].0.2")@chrome://selenium-ide/content/tools.js -> file:///home/elopio/installers/smartclient/SmartClient_SC_SNAPSHOT-2010-08-08/smartclientSDK/tools/selenium/user-extensions.js:243 ("xpath=//table[@id='undefined_table'].0.2")@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 ("xpath=//table[@id='undefined_table'].0.2","core")@chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js:138 ("xpath=//table[@id='undefined_table'].0.2","core")@chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js:199 ([object Object],[object Object])@chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js:349 ()@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:112 (-3)@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:78 (-3)@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 , name -> TypeError

    Comment


      #3
      Now I'm trying to type on a single HTML text field and I get:

      [error] Unexpected Exception: message -> invalid array length, fileName -> http://79.125.3.16/openbravo/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js?_version=7.0.5&_language=192, lineNumber -> 3721, stack -> isc_c_AutoTest_getLocatorFormItem("id=paramClient")@http://79.125.3.16/openbravo/web/org.openbravo.userinterface.smartclient/isomorphic/ISC_Combined.js?_version=7.0.5&_language=192:3721 SJOWContentBoundary()@:0 , name -> RangeError

      So, is not possible to combine non-sc actions with sc actions?

      Wouldn't it be better to first ask if the locator is of type scLocator. And if it isn't, use default selenium. If it is, use sc user extensions. ?

      Comment


        #4
        The sc selenium user extension should be handling this. I'll look into it but feel free to file an issue in tracker. You also have access to the sc selenium user-extensions.js source which is quite simple to follow so you can try debugging the issue yourself too.

        Sanjiv

        Comment


          #5
          Great. Could you tell me where's the issue tracker?

          thanks.

          Comment


            #6
            Any updates on this issue? It is biting me now also :(

            Comment


              #7
              If I use smartgwt user-extensions - selecting by something else then scLocator does not work

              Comment


                #8
                I'm getting this same problem when I try and use the Selenium IDE on a simple html input text box as part of a login page. It manages to write the username into the text box but then dies on ISC_Core.js, lineNumber -> 3646 as per the log below.

                HTML:

                <td>Username</td>
                <td><input class="normal_text" type="text" id="username" name="username" style="height: 30px" onkeypress="if (enterPressed(event)) document.getElementById('password').focus();"/></td>


                TESTCASE:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                <head profile="http://selenium-ide.openqa.org/profiles/test-case">
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                <link rel="selenium.base" href="" />
                <title>test</title>
                </head>
                <body>
                <table cellpadding="1" cellspacing="1" border="1">
                <thead>
                <tr><td rowspan="1" colspan="3">test</td></tr>
                </thead><tbody>
                <tr>
                <td>type</td>
                <td>username</td>
                <td>admin</td>
                </tr>

                </tbody></table>
                </body>
                </html>


                LOG:

                * [debug] createForWindow
                * [debug] browserName: Netscape
                * [debug] userAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
                * [debug] modifyWindow seleniumMarker1284472488505:undefined
                * [debug] _getFrameElement: frameElement=null
                * [debug] isPollingForLoad false, this.pollingForLoad[1]: undefined
                * [debug] Starting pollForLoad (selenium1284472488506): http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _getFrameElement: frameElement=null
                * [debug] pollForLoad original (selenium1284472488506): http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: currentHref: http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: originalHref: http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: sameDoc: true
                * [debug] _isSamePage: sameLoc: true
                * [debug] _isSamePage: sameHref: true
                * [debug] _isSamePage: markedLoc: true
                * [debug] pollForLoad continue (selenium1284472488506): undefined
                * [debug] modifyWindow seleniumMarker1284472488505:undefined
                * [debug] _getFrameElement: frameElement=[object XPCNativeWrapper [object HTMLIFrameElement]]
                * [debug] frameElement.name=
                * [debug] isPollingForLoad false, missing uniqueId seleniumMarker1284472488505: undefined
                * [debug] Starting pollForLoad (selenium1284472488511): http://localhost:8080/blueprint/Authentication/A883B589E7C3344E997FAA70A3F4C037.cache.html
                * [debug] _getFrameElement: frameElement=[object XPCNativeWrapper [object HTMLIFrameElement]]
                * [debug] frameElement.name=
                * [debug] modifySeparateTestWindowToDetectPageLoads: this window is a frame; attaching a load listener
                * [debug] dgf this.uniqueId=seleniumMarker1284472488505
                * [debug] dgf marker=selenium1284472488511
                * [debug] dgf frameElement['frame'+this.uniqueId]=selenium1284472488511
                * [debug] dgf frameElement[this.uniqueId]=selenium1284472488511
                * [debug] getCurrentWindow newPageLoaded = false
                * [debug] currentTest.start()
                * [debug] currentTest.continueTest() - acquire the next command
                * [debug] currentTest.continueTestAtCurrentCommand()
                * [debug] currentTest.resume() - actually execute
                * [debug] runScheduledPollers
                * [debug] pollForLoad original (selenium1284472488506): http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: currentHref: http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: originalHref: http://localhost:8080/blueprint/Authentication/Authentication.html
                * [debug] _isSamePage: sameDoc: true
                * [debug] _isSamePage: sameLoc: true
                * [debug] _isSamePage: sameHref: true
                * [debug] _isSamePage: markedLoc: true
                * [debug] pollForLoad continue (selenium1284472488506): undefined
                * [debug] runScheduledPollers DONE
                * [info] Executing: |type | username | admin1 |
                * [debug] Command found, going to execute type
                * [debug] modifyWindow seleniumMarker1284472488505:selenium1284472488506
                * [debug] _getFrameElement: frameElement=null
                * [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1284472488506
                * [debug] modifyWindow seleniumMarker1284472488505:1
                * [debug] _getFrameElement: frameElement=[object XPCNativeWrapper [object HTMLIFrameElement]]
                * [debug] frameElement.name=
                * [debug] modifySeparateTestWindowToDetectPageLoads: already polling this window: selenium1284472488511
                * [debug] getCurrentWindow newPageLoaded = false
                * [error] Unexpected Exception: message -> invalid array length, fileName -> http://localhost:8080/blueprint/Authentication/sc/modules/ISC_Core.js, lineNumber -> 3646, stack -> isc_c_AutoTest_getLocatorFormItem("username")@http://localhost:8080/blueprint/Authentication/sc/modules/ISC_Core.js:3646 SJOWContentBoundary()@:0 , name -> RangeError
                * [debug] commandError
                * [debug] testComplete: failed=true

                Comment


                  #9
                  In the last post, have you tried running this without the SmartClient extensions loaded?

                  Comment


                    #10
                    Yes - it works fine in the Selenium IDE without the userExtensions.

                    Comment


                      #11
                      Yeah, I've noticed a few other problems that exist when the SmartClient extensions are loaded, such as the inability to use the assignID function with an scLocator pattern generated from the SmartClient IDE extension.

                      While I'm thankful for the limited Selenium support SmartClient has provided in the form of the extensions, they are far from complete and not really robust enough for general consumption. I hope that defects like this are being tracked somewhere beyond a forum and will be resolved in future builds.

                      I see you're encountering the "invalid array length" message. You aren't by chance using assignID with an scLocator?

                      Comment


                        #12
                        It doesn't make sense to use assignId() with an scLocator. The scLocator is the stable id and no DOM ids should be used directly.

                        The extensions have already been used by multiple organizations to create very large test suites. Please do not offer a critique of their maturity while you are just beginning to understand how to use them.

                        Comment


                          #13
                          I agree my critique is based on my own experiences using the extensions, and that I am still learning. My critique is not at your core product, which undoubtedly is the cutting edge in Ajax development, and is extremely robust and well documented.

                          Specifically with the extensions, one example of the lacking of robustness I've encountered is the limitations in using native Selenium select() method to interact with drop down lists. It seems the way SmartGWT ultimately renders certain DDLs (ComboBox / PickList) is a combination of text fields, images, tables, and multiple event handlers. Selecting DDL elements programatically / dynamically becomes extremely convoluted in this situation. The story is similar for other common DHTML controls and the associated Selenium commands, such as radio buttons and checkboxes, which render as 4-state images. Selenium's Select and Check/Uncheck are ineffective against the GUI control.

                          While the extensions provide the scLocator pattern and give much needed support for ListGrid interactions, I personally don't feel they go far enough in extending Selenium's support for "common controls" generated via SmartGWT code. I feel it's enough to get the SmartGWT + Selenium community started, but is far from robust. As we are utilizing SmartGWT and Selenium, I will be creating our organization's large test suite. But I'm still struggling as it feels like I'm working around a work around in some cases.

                          -Respectfully
                          Last edited by nchristie; 16 Sep 2010, 07:47.

                          Comment


                            #14
                            It seems like you're missing the big picture of what problem the extensions solve. The purpose is to create HTML-independent locators for UI components since the HTML structures generated by SmartGWT are considered internals and differ by platform, skin and version of SGWT.

                            So, don't start from Selenium APIs for interacting with plain HTML elements, start from what Selenium records when the extensions are used.

                            If you encounter bugs, post test cases, and ideally purchase support so you can request fixes as needed.

                            If you want enhancements, such as a convenience method similar to select() that works with scLocators, there's a Feature Sponsorship process for handling that.

                            Comment


                              #15
                              Thanks Iso; I'll the greedy part of me just wanted a fix that solved all of my problems handed to me on a silver platter. I realize now that the extensions don't fix everything, but do empower users such as myself to build the support systems / libraries / wrappers we need to successfully automate our SGWT application using tools like Selenium.

                              Comment

                              Working...
                              X