'Sets the username field to the desired value. This requires a login form'

def set_login_username(self, username):

    assert self.is_login_form(), 'Login    form    is    required'
    (text, passwd, other) = self.get_parameter_type_count()
    assert (text == 1), 'Login    form    with    username    is    required'
    for (k, v, path, setter) in self.iter_setters():
        if (self.get_parameter_type(k).lower() == INPUT_TYPE_TEXT):
            setter(username)
