Identifying a Button by its tool tip
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Thanks for your response.
Alright, I was just curious. The script method works perfectly fine.
Slightly off topic, but if I really wanted the tool tip to be recognized as a property, could I do so with a custom plugin?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> could I do so with a custom plugin?
At least you may investigate and try: https://support.smartbear.com/testcomplete/docs/working-with/extending/custom-plugins.html
/Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Thanks for the link. This is something I'll be researching.
Thanks again!
