通过Robot Framework,有2种方法解析和获取 Web Table。
1)此脚本通过get text获取整行tr的数据,再进行处理
${Pgxxx_webList_tableBody_row_locator} //*[@class='xxx']/div[1]//*[@class='el-table__body']/tbody/tr
get_table_data_Pagexxx
${web_list} Get WebElements ${Pgxxx_webList_tableBody_row_locator}
${length} Get Length ${web_list}
${table_list} Create List
FOR ${i} IN RANGE 0 ${length}
${text} Get Text ${web_list}[${i}]
${list} Split String ${text} \n
Append To List ${table_list} ${list}
END
[Return] ${table_list}
#假设table body是一个3行3列:
${text}='a\nb\nc'
${text}='1\n2\n3'
${text}='d\ne\nf'
${list}=['a','b','c']
${list}=['1','2','3']
${list}=['d','e','f']
${table_list} = [['a