'Assigns a temporary identifier to element specified by `locator`.
This is mainly useful if the locator is complicated/slow XPath expression.
Identifier expires when the page is reloaded.
Example:
| Assign ID to Element | xpath=//div[@id="first_div"] | my id |
| Page Should Contain Element | my id |'

@keyword
def assign_id_to_element(self, locator, id):

    self.info(("Assigning    temporary    id    '%s'    to    element    '%s'" % (id, locator)))
    element = self.find_element(locator)
    self.browser.execute_script(("arguments[0].id    =    '%s';" % id), element)
