2017-02-17 24 views
1

forループで複数の条件を確認しようとしていますが、これは決してtrueを返しません。ロボットフレームワークを使用したforループの複数条件チェック

: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を返しません。

+1

のようなものを試してみてください。 [現在のドキュメント](http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Should%20Contain)によると、期待値が見つからない場合、「含めるべきかどうか」が「失敗」します。 –

+0

@Würgspaß私は申し訳ありませんが、実行キーワードと戻り状況 – vinu

答えて

4

は、私は `ランKeywords`orが`任意の値を返すContain`べきだとは思いません。この

: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 Keyword And Return Status Run Keywords Should Contain ${ColumnText1} ${VoucherNumber} AND Should Contain ${ColumnText2} ${Voucherdate} AND Should Contain ${ColumnText3} ${VoucherAmount} 

     Exit For Loop If ${bStatus} 
+0

それはエラーを提供します:キーワード 'builtIn.Should含める'は2〜4の引数が必要です9を持っています – vinu

+1

回答を編集しました '$ {bStatus} = $ {ColumnText1} $ {VoucherNumber}を含み、$ {ColumnText2} $ {Voucherdate}を含む必要があり、$ {ColumnText3} $ {VoucherAmount} 'が含まれている必要があります。 – Vivi

+0

はい、今すぐ動作します。ありがとう – vinu

関連する問題