Robot Framework Headless Testing

A common scenario for Front End testing is to setup the automation suite to run against a specified set of browsers.  That approach is very common, and has its merits, but how do you tackle that same scenario when the System Under Test (SUT) does not have an output display, such as a Continuous Integration (CI) environment?  CI servers often only utilize a Command Line Interface (CLI) to access the server, and do not provide display output.

One solution is to run the tests headlessly, using a virtual browser such as Xvfb (X virtual framebuffer).  Xvfb enables automated tests to run in the CLI without  a graphical front end.  It displays PASS/FAIL results in the CLI realtime!

screen-shot-2017-02-22-at-9-54-27-am

How do we know if the tests render the page the way we desire if we can’t see what is being drawn on the display?  Robot Framework provides report and log files after execution, and during test execution you can tell it to take a screenshot for the Page in Test (PIT).  Those screenshots are added to the report file for ease of consumption!

This slideshow requires JavaScript.

Sample test code can be found on my GitHub repository:

https://github.com/cram-tester/RAQA-SAAS-Robot

Cheers!

Charles

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s