Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
6 replies Latest Post - ‏2013-01-07T18:01:34Z by SystemAdmin
SystemAdmin
SystemAdmin
16727 Posts
ACCEPTED ANSWER

Pinned topic Not able to identify submenu using RFT

‏2012-12-28T07:15:36Z |
Hi All,

Can anyone help me with my problem?

The menu navigation is RFx(s)->Create New -> RFx (refer to screenshot), recorded the steps and the code generated is

//recorded script
html__5_navbar_li().click(atPoint(26,11)); - clicking first menu
browser_htmlBrowser(document_emptoris(),DEFAULT_FLAGS).click(atPoint(489,242)); - clicking second menu

The second menu is getting identified as browser object and if i don't provide the co-ordinates then playback is failing. Neither RFT is identifying the second menu using object inspector nor time-delayed selection.

Actually i dont want to use coordinates, are there any other ways to identify the submenu.

By using firebug i inspected the element and the attributes associated to that element are class and topid, with these properties tried to identify using find() method but RFT is not able to recognize ( is this would be because test object doesn't .id property?

Does RFT supports Xpath in recognizing objects like selenium?

Any help is appreciated. Thanks in advance!
Updated on 2013-01-07T18:01:34Z at 2013-01-07T18:01:34Z by SystemAdmin
  • loub52
    loub52
    1 Post
    ACCEPTED ANSWER

    Re: Not able to identify submenu using RFT

    ‏2013-01-03T14:49:05Z  in response to SystemAdmin
    Have you tried tabbing through menu items, in addition to using shortcut key combinations to get a successful playback?
    • SystemAdmin
      SystemAdmin
      16727 Posts
      ACCEPTED ANSWER

      Re: Not able to identify submenu using RFT

      ‏2013-01-04T09:21:42Z  in response to loub52
      Tabbing is not working on the menu items. If you have any solutions pls provide the code also
      • SystemAdmin
        SystemAdmin
        16727 Posts
        ACCEPTED ANSWER

        Re: Not able to identify submenu using RFT

        ‏2013-01-07T13:12:40Z  in response to SystemAdmin
        have you tried hovering?

        public static boolean searchAndHoverButton(TestObject parent,
        String buttonText) {
        boolean blReturn = false;
        TestObject[] toUniObject = parent.find(atDescendant(".class", "Html.A",
        ".text", buttonText));

        if (toUniObject.length > 0) {
        ((GuiTestObject) toUniObject[0]).hover();

        blReturn = true;
        } else {
        <logErrors>

        }

        unregister(toUniObject);
        return blReturn;

        }
        • SystemAdmin
          SystemAdmin
          16727 Posts
          ACCEPTED ANSWER

          Re: Not able to identify submenu using RFT

          ‏2013-01-07T17:59:07Z  in response to SystemAdmin
          oh and if the find() method does not get you the menu item object you can try

          • Get another unique property instead of topID using RFT's Test Object Inspector (run > test obj..).

          • Search unmappable objects using the overloaded find() methods eg

          find(atDescendant(".class", "sdsdas"), true);

          • Enable process for testing and do a global seach inc unmappable objects (slow):

          boolean b = getRootTestObject().enableForTesting("procesname.exe");
          if (b) {
          System.out.println("enanled");

          TestObject[] menuItem = getRootTestObject().find(
          atDescendant(".class", "sdsdas", "sadasd", "sadasd"), true);
          System.out.println(menuItem.length);
          }
        • SystemAdmin
          SystemAdmin
          16727 Posts
          ACCEPTED ANSWER

          Re: Not able to identify submenu using RFT

          ‏2013-01-07T17:59:08Z  in response to SystemAdmin
          oh and if the find() method does not get you the menu item object you can try

          • Get another unique property instead of topID using RFT's Test Object Inspector (run > test obj..).

          • Search unmappable objects using the overloaded find() methods eg

          find(atDescendant(".class", "sdsdas"), true);

          • Enable process for testing and do a global seach inc unmappable objects (slow):

          boolean b = getRootTestObject().enableForTesting("procesname.exe");
          if (b) {
          System.out.println("enanled");

          TestObject[] menuItem = getRootTestObject().find(
          atDescendant(".class", "sdsdas", "sadasd", "sadasd"), true);
          System.out.println(menuItem.length);
          }
          • SystemAdmin
            SystemAdmin
            16727 Posts
            ACCEPTED ANSWER

            Re: Not able to identify submenu using RFT

            ‏2013-01-07T18:01:34Z  in response to SystemAdmin
            ahum this

            find(atDescendant(".class", "sdsdas"), true);

            should be

            find(atDescendant(".class", "sdsdas"), false);
            ...:)