Search code examples
pythonseleniumtestingreportrobotframework

How to get the error message in robot framework?


I have created a script to get the error output

***Settings***
Resource           importsLib.robot
Suite Setup     Run Keywords
...             Initialize Test     AND
...             Register Keyword To Run On Failure    Failure Callback
Variables       OMG.yaml

and the keywords

***Keywords***
Failure Callback
     Capture Page Screenshot
     Log Source    loglevel=WARN

but the point is I need to get HTML error message when Back-end didn't send the value to Front-end element sometimes and I need to track the root causes of faults or problems.

Can you offer the best solution for this case?


Solution

  • You can use HttpLibrary but you should also code BE tests for it, there is no way to check it under your FE tests if you are not check parallelly BE http methods.

    You can create your own custom libraries or keywords for it.

    And here is a example of how you can use custom libraries on the Robot Framework : How to create a custom Python code library for the Robot Framework