def parse_output_parameters(params):
    """
    Parse the test case output parameters.

    Args:
        params: res[0].tr.id
    Example:
        ret = parse_output_parameters('result.res.data[0].id')
        e.g. Data.tr.id => Data['tr']['id']
             res.tr.id => res['tr]['id]
             res[0].tr.id => res[0]['tr']['id']
             cookie.SESSION => cookie['SESSION']
             headers.Content-Type => headers['Content-Type']
    """
    param_list = params.split(".")

    # Interception object.
    param_obj = param_list[0]
    param_list.pop(0)

    # Template string.
    template = "['{}']"
    parse_string = ''
    # Parse the test case output parameters.
    for args in param_list:
        if "[" in args:
            left_string = ''
            for num, val in enumerate(args.split("[")):
                if num == 0:
                    val = "['{}']".format(val)
                left_string = left_string + val + "["
            left_string = (left_string[:-1])
            parse_string = parse_string + left_string
        else:
            parse_string = parse_string + template.format(args)
    ret_string = param_obj.lower() + parse_string
    return ret_string