title: How to video-record selenium tests running headless inside a docker?
body: <p>I am running python-selenium tests inside a docker using a headless firefox.</p>
  <p>During these tests I am able to make screenshots with the selenium method for screenshots - but can I use something to 'video' record the virtual display during the whole test (several test scripts with several test methods, with many webdrivers started and stopped).</p>
  <p>So how can I video-record a complete test session?</p>
  <p><strong>Addendum</strong>: I have found a webpage that describes exactly what I need: <a href="https://malinowski.dev/recording-headless-selenium-tests-to-mp4.html" rel="nofollow noreferrer">here</a>. Unfortunately I get an error when I try to do the recording. Here are the commands I am doing:</p>
  <pre><code>xvfb-run --listen-tcp --server-num 44 --auth-file /tmp/xvfb.auth -s &quot;-ac -screen 0 1920x1080x24&quot; python seltest.py &amp;
  ffmpeg -f x11grab -video_size 1920x1080 -i 127.0.0.1:44 -codec:v libx264 -r 12 /tmp/behat_1.mp4
  </code></pre>
  <p>and the error is (for the second command):</p>
  <pre><code>[x11grab @ 0x1d289c0] Cannot open display 127.0.0.1:44, error 1.
  127.0.0.1:44: Input/output error
  </code></pre>