Menu

#19 handle subitems from menus

open
nobody
1
2010-05-11
2010-05-11
Anonymous
No

With the click mouse test case (but also with other test cases that involve selecting a control), you cannot select an item that is for instance inside a menu. For example Open is in the file menu. It would be handy if the File menu opens when hovering a certain time above it, so you can select a subitem.

Now I have to use a macro to select it, but I cannot do checks on the item.

Discussion

  • Benny Cohen

    Benny Cohen - 2010-05-11

    You can use the qaliber test developer to identify the code path to the menu item, then you can place the code path as the value of the click mouse control

     
  • Benny Cohen

    Benny Cohen - 2010-05-11
    • priority: 5 --> 1
     
  • Anonymous

    Anonymous - 2010-05-12

    That is a nice tool. But it does not work on our program, for some reason, the ids are not recognised correctly. The same happens with the calculater program, see attached generated code, this does not work, the calculation is not performed:
    public override void Body()
    {
    UIAButton start13 = Desktop.UIA[@"UIAPane", 1][@"Start", @"Button", @"UIAButton"] as UIAButton;
    start13.Click(MouseButtons.Left, new Point(36, 31));
    UIAEditBox start = Desktop.UIA[@"Start Menu", @"DV2ControlHost", @"UIAPane"][@"", @"Desktop OpenBox Host", @"2"][@"UIAPane", 0][@"Start Search", @"Edit", @"UIAEditBox"] as UIAEditBox;
    start.Write("cal;cu{Back}{Back}{Back}{Return}");
    UIAPane uiapane15 = Desktop.UIA[@"UIAPane", 1] as UIAPane;
    uiapane15.Write("{Return}");
    UIAButton unknown16 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"5", @"Button", @"129"] as UIAButton;
    unknown16.Click(MouseButtons.Left, new Point(13, 12));
    UIAEditBox unknown17 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"5, ", @"Edit", @"403"] as UIAEditBox;
    unknown17.Write("{LeftShift}");
    UIAButton unknown18 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"+", @"Button", @"92"] as UIAButton;
    unknown18.Click(MouseButtons.Left, new Point(16, 15));
    UIAButton unknown19 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"3", @"Button", @"127"] as UIAButton;
    unknown19.Click(MouseButtons.Left, new Point(7, 13));
    UIAButton unknown20 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"=", @"Button", @"112"] as UIAButton;
    unknown20.Click(MouseButtons.Left, new Point(19, 11));
    UIAButton calculator21 = Desktop.UIA[@"Calculator", @"SciCalc", @"UIAWindow"][@"Calculator", @"", @"TitleBar"] as UIAButton;
    calculator21.Click(MouseButtons.Left);
    }