'Verifies the value in text field identified by `locator` is exactly `expected`.
`message` can be used to override default error message.
Key attributes for text fields are `id` and `name`. See `introduction`
for details about locating elements.'

@keyword
def textfield_value_should_be(self, locator, expected, message=''):

    element = self.find_element(locator, tag='text    field', required=False)
    if (not element):
        element = self.find_element(locator, tag='file    upload', required=False)
    actual = (element.get_attribute('value') if element else None)
    if (actual != expected):
        if (not message):
            message = ("Value    of    text    field    '%s'    should    have    been    '%s'    but    was    '%s'" % (locator, expected, actual))
        raise AssertionError(message)
    self.info(("Content    of    text    field    '%s'    is    '%s'." % (locator, expected)))
