Fix UI_driver.has_class exception. Handle situation when element has no class attribute

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk 2018-09-17 14:13:38 +02:00
parent 1affddaabe
commit 46eb9a38f0

View File

@ -1908,7 +1908,8 @@ class UI_driver(object):
"""
Check if el has CSS class
"""
return cls in el.get_attribute("class").split()
class_attr = el.get_attribute("class")
return bool(class_attr) and cls in class_attr.split()
def skip(self, reason):
"""