I am trying to validate the text that is displayed after hovering over a tooltip button by writing an automation script using Java. The button locator has been identified correctly and script is able to hover on the element but it is unable to fetch the text displayed.
Before hover, the button is identified as displayed in first screenshot here.
After hovering, the button is getting an extra attribute as aria-describedby=”overlay 3″ but no where the text is displayed. Usually in all tooltip related validation I have seen that the text can be fetched using .getText() method or getAttribute(“title”) or geAttribute(“validationMessage”) but in my case none of these attributes get activated when mouse is hovered on this element. Shown in screenshot here.
I have attempted to fetch this text using different methods as shown in screenshot here. Note the commented out line of the code also. But I am unable to fetch the text, “In case we need to contact you about your order”. Looking for help to get this sorted out!
I have tried different approaches shown in this screenshot. Note the commented out code also.