A solution for Selenium Python bindings to record video of a test run through repeated screenshot captures. Tested with Firefox and PhantomJS.
gstreamer 1, gst-python, gst-plugins-base, gst-plugins-good
python setup.py install --user
See example.py.
I couldn't make it work with Chrome Driver. Seen a couple of segmentation faults. Also note that video encoding is quite CPU-intensive.