there is a website with the following HTML-Code-snippet:
<li class="quest" data-questid="Battle_02" data-category="battle">
<img src="img/x.gif" alt="" class="reward">
<a href="#">Versteck bauen</a>
</li>
I want to click on this list item. The only list item with the img inside. I find the items with xpath. And tried to click on them. I tried it with the "li" token:
xpath = "//img[@class='reward']/parent::*"
With the img:
xpath = "//img[@class='reward']
And with the "a href":
xpath = "//img[@class='reward']//following::*"
Then I'm trying to click on it with the following code:
click_me = self.browser.find_element_by_xpath(xpath)
click_me.click()
But I get an Element is not clickable at point exception.
So I tried it with an action:
action = ActionChains(self.browser)
action.move_to_element(click_me).click().perform()
and with:
action.move_to_element(click_me).move_by_offset(4,0).click().perform()
I don't get an error with this but it still doesn't work.
EDIT: Used chrome-driver 2.31. Switching to 2.34 solved my problem!