3
votes

I am testing tooltips on my web page using Selenium WebDriver with Firefox.

I'm trying to hover over the element that has the tooltip attached. To test that the tooltip is displayed and then to hover over another element and test its respective tooltip.

element_to_click = claim_section.find_element_by_class_name("arrowBox")
hover_mouse = ActionChains(self.driver).move_to_element(element_to_click)
hover_mouse.perform()

At any given time, we see only one tooltip when I test it manually. But when I run this test the first tooltip does not hide. I tried to move over another element on the page but the tooltip remains visible.

Am I missing any other action here and what are the possible solutions?

1
Does this happens in every Web Browser? - aimbire
I have tried this in Firefox only. since my automated tests run on Firefox. - nids
don't you need some "mouseout" action as well? - RST
@RST - Yes, I think I do but none of the ones I tried work. I tried to click on any other element on the page. I also tried to move to an offset and click there. Do you have any suggestions for "mouseout" actions in selenium + python? - nids
I am not too familiar with it but this may help you stackoverflow.com/questions/15073351/… - RST

1 Answers

0
votes

If you have multiple tooltips make sure that you don't reuse the same ActionChains object. I loop over my tooltips like so:

for element in elements:
    ActionChains(self.driver).move_to_element(element).perform()