I have been trying for a while to complete this task. For context, I have a link called with text "Main Menu" along the top of the page, that when hovered reveals a list of more links. These links can either be clicked, to take you to the main page of that heading, or hovered over, to show more links related to that page.
Right now I have a hover method:
hover = ActionChains(self.browser)
hover.move_to_element((self.browser.find_element_by_link_text(elementId)))
hover.perform()
Where elemendId is the parameter passed to the hover method.
After this hover method is called, I click on link and it works correctly, but if I try to call my hover method twice in a row and then click on the link, it will navigate down to the given menu option, reveal the link that I am wanting to click, and then closes the menu before it has the chance to click on the link.
I have also been looking in to executing a Javascript function to call attempt to hover
self.browser.execute_script("$(\"a:contains('Main Menu')\").hover();")
but I don't have much experience with it and I am unsure if this is anywhere close to correct.
Thanks for your time, Waq