SeleniumBase: self.hover_and_click() does not support xpath

Look like self.hover_and_click() does not support xpath any way. I try to use just

def test_sub_menu(self):
        self.get("https://www.babyshop.com")
        self.hover_and_click('//a[@data-class="babyshoes"]', '//div[@class="babyshoes mid-navigation-container"]//a')

and try

from selenium.webdriver.common.by import By
def test_sub_menu(self):
        self.get("https://www.babyshop.com")
        self.hover_and_click('//a[@data-class="babyshoes"]', '//div[@class="babyshoes mid-navigation-container"]//a',By.XPATH,By.XPATH)

but its function work only with css-selector

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

So, its not necessarily hover_and_click() that’s impacted. For me, slow_click() stopped working on updating to 1.36.1. In general, I feel all methods using xpath selector with sub-attributes would be impacted

self.slow_click("//span[@title='Close popup']", by=By.XPATH)

Its definitely some change in the newer seleniumbase version that broke this, since going back to 1.34.18, the above code works fine.

I haven’t gotten to determining the exact change causing this, but for now, will workaround by changing the selector.