标题: robotframework按行读取excel添加到LIst 无法一行一行的读,请大佬帮忙 [打印本页] 作者: 晓芳 时间: 2023-10-25 11:28 标题: robotframework按行读取excel添加到LIst 无法一行一行的读,请大佬帮忙 打开文件 D:\\RF\\case2.xls
${count_row1_sheet1} get row count 注册接口
@{row_list} Create_list
${count_column_sheet1} get_column_count 注册接口
FOR ${x} IN RANGE ${count_row1_sheet1-1} #读取Count-1次(不读取第一行)
${read_row_sheet1} get row values 注册接口 ${x+1}
log 第${x}行
清除列表 ${row_list}
读取每列 ${count_column_sheet1} ${read_row_sheet1} ${row_list}
END
clear List
@{row_list} Create_list 1 2 3
log 清除前列表:${row_list}
#${row_list} Evaluate ${row_list}.clear()
FOR ${index} IN @{row_list}
Remove values from list ${row_list} ${index}
END
log 清除后列表:${row_list}
读取每列
[Arguments] ${count_column_sheet1} ${read_row_sheet1} ${row_list}
@{dict_key} Create_list id title req_data assert_list
FOR ${i} IN RANGE ${count_column_sheet1} #循环文本列数次
${row_values} Set_variable ${read_row_sheet1[${i}][1]}
Append_to_list ${row_list} ${row_values}
log 第一行列表${row_list}
END
结果总是将两行数据都追加到一个列表里了,我想一行放入一个列表,但是不知道怎么处理,将列表删除也不行,请大佬帮忙