My selenium tests are triggered from Jenkins server which in AWS EC2-Ubuntu. But in EC2, since tests run on chrome-headless, debugging has become difficult. I tried XVFB display but had unresolved issues installing and connecting to it. I am checking here to see if there is any other option to view chrome browser on EC2. Other alternate configuration or architectural options to make this set up work are also welcome.
Selenium allows us to take screenshots of the browser viewport, even if the browser is running in headless mode. We can use that functionality to generate a video recording. After all, a video is just a set of frames. Taking a screenshot with Selenium is easy:
Source - Liviu Lupei
The article continues on to show how to stitch those together into a video, using FFmpeg.