【发布时间】:2026-02-02 13:50:01
【问题描述】:
我正在尝试使用机器人框架检查 for 循环中的多个条件,但它永远不会返回 true。
:FOR ${RowIndex} IN RANGE 0 ${rowscount}
${ColumnText1} Get Text //*[@id='RadSearchGrid_ctl00__${RowIndex}']/td[3]
${ColumnText2} Get Text //*[@id='RadSearchGrid_ctl00__${RowIndex}']/td[4]
${ColumnText3} Get Text //*[@id='RadSearchGrid_ctl00__${RowIndex}']/td[5]
${bStatus} | Run Keywords | Should Contain | ${ColumnText1} and ${ColumnText2} and ${ColumnText3} | ${VoucherNumber} and ${Voucherdate} and ${VoucherAmount}
Exit For Loop If ${bStatus}
${bStatus} 从不返回 true。
【问题讨论】:
-
我认为
Run Keywords或Should Contain不会返回任何值。根据current docShould Contain“失败”,如果没有找到预期值。 -
@Würgspaß 对不起,是运行关键字并返回状态
标签: robotframework