[英]RobotFramework: Can not leave the error message if the element is not exist
robotFramework測試案例:
verify that user can send a request and redirect to next page
Wait until element is enabled ${errorCodeMessage}
Element Text Should Be ${errorCodeMessage} Vikailmoituksen tapahtumat
輸出日志:
Send request with 'Proprietary Tag' field :: OK: User is able to s... | FAIL |
Element locator '//h2' did not match any elements after 5 seconds
如果元素不存在,如何返回錯誤消息(例如:“此頁面上沒有這樣的元素”)? 而不是這樣: "Element locator '//h2' did not match any elements after 5 seconds"
根據文檔, 等待直到啟用元素會接受錯誤消息作為參數。 因此,它看起來像這樣:
Wait until element is enabled ${errorCodeMessage}
... error=There is no such element on this page
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.