Forum Discussion

SuperTester's avatar
SuperTester
Contributor
3 years ago
Solved

Identifying a Button by its tool tip

Hey guys,

 

I would like identify a button by its tool tip. However, the tool tip property (wText I think) is not found by test complete, but I can get the tool tip by using the java method getToolTipText().

 

Is there a way to configure a object in namemapping to get such that its identified by the result of a method and not by a property? Maybe there's a trick using conditional mode.Otherwise, I think I'd need to write a script. Something like,

 

function findObjWToolTip()
{
var myToolTip,myBtn,windowObj;
var buttons = windowObj.FindAll(['Name'], ['MJButton'], depth, True);
for (var i = 0; i < buttons.length; i++)
{
if (buttons[i].getToolTipText() == myToolTip)

{
myBtn = buttons[i]

break;
}

}
}

 

Thanks in advance!

  • Hi,

     

    Is there a way to configure a object in namemapping to get such that its identified by the result of a method and not by a property?

     

    No to the level of my knowledge. So you'll have to stick to the code that you've mentioned.

     

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Is there a way to configure a object in namemapping to get such that its identified by the result of a method and not by a property?

     

    No to the level of my knowledge. So you'll have to stick to the code that you've mentioned.