You can use the âMonte Media Libraryâ java based library developed by Werner Randelshofer to record the selenium webdriver execution video, Following are the steps to use this -
1- Download âMonteScreenRecorder.jarâ from link
http://www.randelshofer.ch/monte/
2- Add this jar file to webdriver eclipse project.
3- Jar file contain âScreenRecorderâ class, create the class object like -
public ScreenRecorder(java.awt.GraphicsConfiguration cfg,
java.awt.Rectangle captureArea,
Format fileFormat,
Format screenFormat,
Format mouseFormat,
Format audioFormat,
java.io.File movieFolder)
throws java.io.IOException,
java.awt.AWTException
Creates a screen recorder.
Parameters:
cfg - Graphics configuration of the capture screen.
captureArea - Defines the area of the screen that shall be captured.
fileFormat - The file format "AVI" or "QuickTime".
screenFormat - The video format for screen capture.
mouseFormat - The video format for mouse capture. The EncodingKey must be ENCODING_BLACK_CURSOR or ENCODING_WHITE_CURSOR. The SampleRateKey can be independent from the screenFormat. Specify null if you don't want to capture the mouse cursor.
audioFormat - The audio format for audio capture. Specify null if you don't want audio capture.
movieFolder - Where to store the movie
Throws:
java.io.IOException
java.awt.AWTException
4- call âscreenRecorder.start()â methods at starting of your test scripts and âscreenRecorder.stop()â at the end of execution.
5- After execution of test script, the video file is generated under âVideoâ folder of current user folder in Windows machine and âMoviesâ folder on Mac machine.