Forum Discussion

forrestaustin's avatar
forrestaustin
Contributor
6 years ago
Solved

Is there a way to find the tooltip of a text field using a script?

I have a .NET application that I am writing a script for to check the min and max range of text fields. If the value entered is out of range then a tooltip appears stating the range. Is there a way t...
  • tristaanogre's avatar
    6 years ago

    Many times, an object will have a property called "Tooltip".  The tooltip itself is not a seperate object but a property that is populated as needed.

    So... my first thing to check would be to use the TestComplete Object Spy to inspect the edit field and look to see if such a property exists.  If this works, you wouldn't need to know the name of the tooltip object, simply check the tooltip of the edit box and validate the text.

  • tristaanogre's avatar
    tristaanogre
    6 years ago

    As mentioned... that was step one... .time to play Sherlock, my friend.

    so... step 2, since there doesn't appear to be a relevant property on the target object, the tooltip probably is a separate object.

    Using Object Spy, there's a method for object spy called Point and Fix.  Instead of the target reticule, you can use the Point and Fix method to highlight objects that might not be able to be targetted... can you use that for highlighting the tool tip?

    To anticipate your question as to why I don't have a "Well, all you have to do is reverse the polarity of the neutron flow" is because there are many different ways for developers and components to generate tool tips.  So, we need to investigate and find it.  Now, of course, if you have access to the developers, you could ask them... show them what you're trying to do, sit with a developer with TestComplete open, show them the Object Browser... and see if they can help you find the tooltip.  Honestly, that's the best way to go to make your life easier...