5

I like the level of details and more or less how they look like — report.html and log.html files created as a result of selenium/robot tests run. What I don't like is if I run pybot several times (with different tags for example) these files gets rewritten, and I loose previous run results unless I'm running all of them as a predefined set.

I thought it would be nice to store test runs results in a database.

Are there any ready or obvious solutions for that easier than to fire up a django site to handle all that? I want to be able to see a list of available last few hours/days results and click and see details the same way I can dig in now from report.html into log.html down to the individual steps. Would be nice if it'll support multiple users + continuos integration writing results into the same database. Being able to see results from various hosts through a browser without ssh-ing into these machines seems important.

4 Answers 4

2

To prevent overwriting the earlier results, you can specify where you want the logs and results with command line options --output, --log (-l) and --report (-r). There is also an option --timestampoutputs (-T) for automatically timestamping the result files to get output-20080604-163225.xml or similar.

There seems to be at least two database libraries Robotframework-Database-Library and robotframework-dblibrary. I haven't used either so unfortunately I can't comment on them.

2

As a previous answer stated, it is possible to save the test output as XML (output.xml) but to put the results into a database, you would have to create a parser and table structure to handle all that.

If you are just wanting to have the test results stored in a central place then I would recommend setting up Jenkins and running your Robot Framework tests from there. Loading the Robot Framework plugin adds some really nice reporting functionality: how the test results differed from the previous result, if tests were added or removed, how long a test has been failing; see the link below: (see "Detailed Build view" screenshot)

https://wiki.jenkins-ci.org/display/JENKINS/Robot+Framework+Plugin

2

For a pre-built solution you might want to look at DbBot.

For a custom solution you can use the listener interface to robot framework. It's pretty easy to write a listener that writes a record to a database every time a keyword, test case or test suite finishes running.

My team created a little web service for this, but you can just as easily open a direct connection to your database from the listener and store the results directly.

-1

On a Linux machine, you can direct Pybot to save log files to a different folder which is time-stamped:

-d results/result-$(date +%Y%m%d-%H-%M-%S)
1
  • 1
    Welcome to SQA Stack Exchange. We prefer longer answers with more explanation - please edit your answer to explain how piping to a directory on the local system would help with viewing results through a browser and being able to view results from multiple hosts.
    – Kate Paulk
    Oct 23, 2017 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.