Skip to content
Get Free Trial

Getting the text of a tool tip

Here is how you can get the text of a tool tip.

  1. Identify the tool tip manually through the controller. It may be some div, for example.
  2. In your script, now you can do the following.
    1. Do a _mouseOver(element) to view the tooltip div.
    2. Do a getText() of the tooltip div to get the tooltip text.

Example:

_navigateTo("http://jqueryui.com/tooltip/");
_mouseOver(_textbox("age")); // To view tooltip of age textbox.
_alert(_getText(_div("ui-tooltip-content"))); // We identified the div by quick mouse over on the tool tip.