由于公司最近做RPA系统比较多,有时候单独的看日志看不出Selenium的具体问题,需要了解运行到哪一步出错,因此需要将RPA运行的过程录制下来。
需要Jar包 screen-recorder-0.7.7.jar
//Video Record
public static ScreenRecorder createScreenRecorder(String dir_download,String fileName) throws IOException, AWTException {
ScreenRecorder screenRecorder;
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
screenRecorder = new ScreenRecorder(gc,
null, new Format(MediaTypeKey, MediaType.FILE, MimeTypeKey, MIME_AVI),
new Format(MediaTypeKey, MediaType.VIDEO, EncodingKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
CompressorNameKey, ENCODING_AVI_TECHSMITH_SCREEN_CAPTURE,
DepthKey, (int)24, FrameRateKey, Rational.valueOf(15),
QualityKey, 1.0f,
KeyFrameIntervalKey, (int) (15 * 60)),
new Format(Media