我被困住了,我不知道如何继续。我到目前为止已经提出了代码
${row_count}= get element count ${basic_info_table_row}
Should Be Equal As Integers ${row_count} 12
${column_count}= get element count ${basic_info_table_column}
Should Be Equal As Integers ${column_count} 2
${row_list}= BuiltIn.Create Dictionary
FOR ${row} IN RANGE ${row_count}+1
${row_text} get text ${basic_info_table_row}
log to console ${row_text}
END
答案 0 :(得分:0)
您使用FOR ${row} IN RANGE ${row_count}+1
进行了循环,但在循环内 的任何地方都没有使用${row}
。该块${row_text}
和${basic_info_table_row}
中的两个值每次都保持相同。
如果您想使用$row
作为索引,则将其与${basic_info_table_row}
一起使用。或在xpath中使用$row
或${basic_info_table_row}
使用的标识符(或仅使用${basic_info_table}
)-不在您的问题之内。
有关如何使用标识符中的索引的信息,请参见this answer。请注意xpath中使用的tr[${row}]
:
${row_text}= Get Text xpath=/html[1]/body[1]/div[5]/section[1]/div[6]/table[1]/tbody[1]/tr[${row}]/td[6]