【发布时间】:2015-11-24 12:56:10
【问题描述】:
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"
【问题讨论】:
-
我不知道robotFramework,但通常您会使用try/catch 来捕获NoSuchElement 异常并将自定义消息写入日志。
-
@JeffC:这不是你在机器人框架中的做法。
标签: python selenium wait robotframework