2

How do I check if the tooltip appears or not in selenium? When mouseovering the element, I can see the tooltip appear. How do I verify that the tooltip appears?

enter image description here

HTML of the Icon:

<td class=" text-center selection"> 
<p data-toggle="tooltip" title="" data-original-title="Je kan geen modules verwijderen die reeds gebruikt worden in de programmakalender">
<i style="color: orange;" class="icon-warning-sign icon-large"></i></p></td>

I can mouseover the icon with selenium, but I don’t know how I can verify that it appears (or not).

Any help?

1 Answer 1

1

Found an answer.

<p data-toggle="tooltip" title="" data-original-title="Je kan geen modules verwijderen die reeds gebruikt worden in de programmakalender" aria-describedby="tooltip594806" >

The aria-describedby="tooltip594806"gets added afterwards, when hovering I can see if this appears or not.

1
  • 1
    Just from experience, never trust the mark up. Small changes to the css or js at some point could end up breaking the functionality of the specific attribute. It probably won't but if it happens (and I've seen it happen) tests become green that shouldn't. Using something along seleniums isDisplayed() method generally yields better results.
    – Daniel
    Aug 24, 2017 at 5:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.