Tooltip Testing

Hover Over Tooltip

Testing a tooltip can be difficult, since right-clicking the tooltip to map the field in Test Builder will cause the Tooltip to disappear. We need therefore to map the field manually.

Step 1: Right-click on the field which produces the tooltip and choose Inspect (or press F12):

Step 2: In a PageObject of type LinkType(), create a WebElement for the located tooltip icon:

Step 3: In the Test Case, choose the Hover option on UI Action Test Step.

Assert Tooltip

Now that the tooltip is appearing, we need to manually map the tooltip to be able to assert it.

  1. In Chrome, hover over a field with a tooltip and choose Inspect (or press F12)
  2. Move to the ‘Elements’ tab of Inspect (or press Ctrl + Shift + C)
  3. Click the Tooltip and the element will be shown at the bottom of the screen
  4. Use the up and down keys on the keyboard to locate the element you would like to map. Once you find it, right-click and select ‘Copy Xpath’ or ‘Copy CSS Path’ to add the locator to the clipboard
  5. Add the new locator to the Page Object manually
  6. Add a UI Assert Test Step to your Test Case and add the expected test of the tooltip to be asserted


Leave A Comment