When I write testcase with Robot Framework, I write some error log with Robot Framework API logger.error(msg, html=False), when the test is finished, how can I get the error message?
For example, after the test is finished, log is as below:

how can I get the error message that marked in red rect?
@Alex Bruce. I was having the same issue. Use "Run Keyword And Ignore Error" with variable infront of it. That variable will have the Fail result you are looking for.
> *** Settings *** Documentation Test Suite Teardown Close All Browsers Library Selenium2Library timeout=10
>
> *** Variables *** ${BROWSER} chrome ${SLEEP} 3
>
> *** Test Cases *** Testing
> Error Logging
>
> *** Keywords *** Open Google
> Open Browser http://google.com/ ${BROWSER}
> Wait Until Page Contains Damn timeout=1
>
> Error Logging
> ${ErrorChk} = Run Keyword And Ignore Error Open Google
> log ${ErrorChk[1]}
Starting test: Error.Testing
20170731 17:57:13.874 : INFO : Opening browser 'chrome' to base url 'http://google.com/'
20170731 17:57:19.131 : INFO : </td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a>
20170731 17:57:19.132 : FAIL : Text 'Damn' did not appear in 1 second
20170731 17:57:19.133 : INFO : ${ErrorChk} = ('FAIL', u"Text 'Damn' did not appear in 1 second")
20170731 17:57:19.133 : INFO : Text 'Damn' did not appear in 1 second
Ending test: Error.Testing
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With