← Back to team overview

schooltool-developers team mailing list archive

Headless Selenium stests

 

Hey guys.

I just wanted to share something I did today that I really liked.

I've been porting some of the gradebook's ftests to Selenium stests, and the more I run the tests the more I hate Chrome popping up above my Gnome Terminal. And the 'Always on top' functionality doesn't help much because the window loses focus sometimes. Has this happened to you?

Anyway, a few days ago I found this article [0] about running Selenium 'headless'. Since it seemed "so easy" today I decided to give it a try.

All I did was adding pyvirtualdisplay to setup.py (which in turns has like 4 more dependencies) and modified the SeleniumLayer class to start/stop the display on setUp/tearDown. (Here's the diff: http://pastebin.com/HNc5tkZB)

And now the stests run without Chrome bothering me!

I don't know yet of any side effects on this or if it's the right configuration, but it would be really nice to have this functionality in our test runner. Maybe with a flag to set visibility...

In the meantime, I'll try to abstract all of this in to a custom buildout.cfg extension.

Douglas

[0] http://coreygoldberg.blogspot.com/2011/06/python-headless-selenium-webdriver.html

"... allí­ es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi

Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html


Follow ups