Announcement

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

    scLocator and explicit IDs

    I've checked out your fine user guide on using Selenium with SmartClient and have already managed to make some tests.

    But now I'm wondering if it's possible to locate a Dialog/Form/ListGrid/etc without the need to supply the explicit ID?

    This is how it works now:
    scLocator=//Dialog[ID="isc_Dialog_0"]/okButton/

    But I wonder if I can locate a Dialog without specifying an explicit ID?
    The following locator returns "_1.match("ID=\\\"(.*)\\\"") is null":
    scLocator=//Dialog[1]/okButton/

    If it's impossible to locate an arbitrary Dialog, is it at least possible to define an explicit ID to SC.warn()?

    EDIT: Also, why can't I use the standard Selenium locators such as name, link, identifier...?
    To be exact, I tried putting "name=userTI" into the Target field and clicked the Find button. It located the textfield successfully. But when I ran the test, it failed with this error:
    [error] Unexpected Exception: QueryInterface -> function QueryInterface() { [native code] }, message -> Security Manager vetoed action, result -> 2153185319, name -> NS_ERROR_XPC_SECURITY_MANAGER_VETO, filename -> http://localhost/MBT/MBT/sc/modules/ISC_Core.js, lineNumber -> 1403, columnNumber -> 0, location -> JS frame :: http://localhost/MBT/MBT/sc/modules/ISC_Core.js :: isc_c_EventHandler__canAccessNativeTargetProperties :: line 1403, inner -> null, data -> null, initialize -> function initialize() { [native code] }
    Last edited by test; 16 Jun 2010, 04:25.

    #2
    I ran SC.warn("foo") and Selenium IDE correctly recorded

    scLocator=//Dialog[ID="isc_globalWarn"]/okButton/

    when the OK button was clicked. Always post the version of SmartGWT and Selenium extensions you are using.

    Comment


      #3
      SmartGWT 2.2 and vanilla Selenium (with only your extensions).

      Oh, sorry, I think the mistake was using the following overloaded method incorrectly (I didn't set an ID on the Dialog instance):
      SC.warn("Login failure", "Check your username and password.",null, new Dialog());

      So, apart from being unable to use the standard selenese locators, the issue is resolved.
      I have a minor feature request. Can you add a SC.warn(title, msg) overload? To other popup windows too, if possible.

      Comment


        #4
        Hi

        I have the same issue. Everytime I see the button id is changing. How to address this, when I develop a test harness. I will be executing the test cases in multiple environment.

        Is there any way to find element through name instead of ID.

        Basically i do the following.

        SeleniumContext.getSelenium().click("scLocator=//Button[ID=\"" + buttonID + "\"]/" + buttonLabel);

        where button id changes from screen to screen. Is there anyway to search the button through name instead of id. ?

        Please help.

        Be sure your post includes:

        1. the SmartGWT or SmartClient version and browser version(s) involved;

        2. for a server-side problem, the complete logs generated during processing of the request;

        3. for a client-side problem, the contents of the Developer Console (see FAQ for usage);

        4. if there is a JavaScript error, the stack trace logged in the Developer Console (from Internet Explorer if possible); and

        5. sample code.

        Posts with incomplete information are much more likely to be ignored.

        Comment

        Working...
        X