'Returns value of the element attribute.
There are two cases how to use this keyword.
First, if only `locator` is provided, `locator` should consists of
element locator followed by an @ sign and attribute name.
This behavior is left for backward compatibility.
Example:
| ${id}= | Get Element Attribute | link=Link with id@id |
Second, if `locator` and `attribute_name` are provided both, `locator`
should be standard locator and `attribute_name` is name of the
requested element attribute.
Examples:
| ${id}= | Get Element Attribute | link=Link with id | id |
| ${element_by_dom}= | Get Webelement | dom=document.getElementsByTagName(\'a\')[3] |
| ${id}= | Get Element Attribute | ${element_by_dom} | id |'

@keyword
def get_element_attribute(self, locator, attribute_name=None):

    if (not attribute_name):
        (locator, attribute_name) = self._parse_attribute_locator(locator)
    element = self.find_element(locator, required=False)
    if (not element):
        raise ValueError(("Element    '%s'    not    found." % locator))
    return element.get_attribute(attribute_name)
