Is there anyway to run robot framework tests without a display?

3.1k views Asked by At

I prepare some test suites for an e-commerce web site, so i use Selenium2Library which requires a running browser on a display. I am able to run these test on my local machine but i had to run them on remote server which does not have an actual display. I tried to use xvfb to create a virtual display but it did not worked, tried all solutions on some answers here but nothing changed.

So i saw pyvirtualdisplay library of Python but it seems like helpful with tests written in Python. I'd like to know that if I am able to run test suites that i wrote in robotframework (which are .txt formatted and could be runnned via pybot) via Python so i can use pyvirtualdisplay?

Sorry about my English, thanks for your answers...

2

There are 2 answers

1
User On

If you want to run selenium and not open a browser window you would use PhantomJS. It does not require a display and you can take screenshots.

0
Michel On

Yes there is with Xvfb installed.

In very short:

/usr/bin/Xvfb :0 -screen 0 1024x768x24&

export DISPLAY=:0

robot your_selenium_test