Check for href attribute in WebElement.is_link

Fixes #2619
This commit is contained in:
Florian Bruhin 2017-05-12 12:59:25 +02:00
parent 9ab4549b9b
commit 17fdda6a5e

View File

@ -294,7 +294,7 @@ class AbstractWebElement(collections.abc.MutableMapping):
def is_link(self):
"""Return True if this AbstractWebElement is a link."""
href_tags = ['a', 'area', 'link']
return self.tag_name() in href_tags
return self.tag_name() in href_tags and 'href' in self
def _mouse_pos(self):
"""Get the position to click/hover."""