Forum Discussion

MHealton's avatar
MHealton
New Contributor
2 years ago
Solved

Clicking an a tag in the same div as a span containing desired text.

Hey all, Our org is fairly new to testcomplete, and I have a feeling someone's already nailed down an elegant solution to this type of problem.  I'm working on building out some regression tests fo...
  • rraghvani's avatar
    rraghvani
    2 years ago

    Try using FindAll Method to search for "Link". For example,

    function MenuItems()
    {
        var menuitems = Aliases.panelMainMenu.FindAll("ObjectType", "Link", 1);
        for (var i = 0; i < menuitems.length; i++) {
            Log.Message(menuitems[i].Name);
        }
    }

    This will output the Link name.

     

    You can then perform menuitems[i].Click() if the menuitem equals what you want.