Selenium tip: Frezee a tool tip or dropdown to get locator

When user mouse hovers an any item (Button/link/field etc), without clicking it, and a tool tip may appear with information about the item being hovered. And Some times it may require us to check for the tooltip text.  Suppose that when ever user mouse hover, it will generate a div tag in which tool tip text resides. Check the below screen shot (https://jqueryui.com/tooltip/).

Selenium jquery tool tip

In this case , we need to find the exact locator of generated tooltip DOM. you can just use Developer tools to show and get what you want, but it will disappear if you click somewhere else.

Let me tell you One trick to frezze the tooltip and you can easily look up the DOM, navigate up and down if needed to get exact locator for the tooltip.

In Chrome browser, Open developer tool (F12), hover on the element that will show the tooltip then press F8 to pause the page. it will frezze the web page and we can find tooltip DOM.

tooltip

Leave a comment