Run Keyword And Ignore Error,Run Keyword And Return Status,Run Keyword And Continue On Failure,Run Keyword And Expect Error,Wait Until Keyword Succeeds用法


 

 

*** Test Cases ***
case1
#即使錯誤也繼續執行,也不記錄失敗,且可以返回執行狀態和錯誤信息
${Run Keyword And Ignore Error status} ${statusValue} Run Keyword And Ignore Error Click Element //span[@title="aaa"]
#執行關鍵字,返回執行成功或者失敗狀態,True和False
${Run Keyword And Return status} Run Keyword And Return Status Click Element //span[@title="aaa"]
${message} Set Variable Are your sure?
#即使錯誤也繼續執行,不中止用例,但是會記錄失敗
Run Keyword And Continue On Failure Should Be Equal ${message} Are your sure?
#這個會報失敗
Run Keyword And Continue On Failure Click Element //span[@title="aaa"]
#執行關鍵字,匹配失敗的信息,如果關鍵字執行成功,則Run Keyword And Expect Error 失敗。比如evaluate 1/0肯定會失敗,則catch失敗信息
${msg} = Run Keyword And Expect Error * evaluate 1/0
Should Start With ${msg} Evaluating expression '1/0' failed: ZeroDivisionError: integer division or modulo
#重復執行關鍵字
Repeat Keyword 2 Log repeat
#在規定時間規定頻率內執行關鍵字,直到成功。如果超時還未成功,則失敗,終止用例執行。
Wait Until Keyword Succeeds 10s 2s log Wait Until Keyword Succeeds 執行成功
Wait Until Keyword Succeeds 10s 2s evaluate 1/0

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM