video-recorder-java
video-recorder-java copied to clipboard
Can't custom video name by [package name + class name + method name + nano timestamp] in TestNG video recording
I am using the latest version of the video recording TestNG branch for my Selenium in the TestNG framework.
and the dependency is:
<dependency>
<groupId>com.automation-remarks</groupId>
<artifactId>video-recorder-testng</artifactId>
<version>2.0</version>
</dependency>
I would like to name the video name as [package name + class name + method name + browser name + nano timestamp], and no idea about this.
I refer to the issue which closed: #30
and found the in TestNG video recording package, without the class VideoRule.java
so I can't custom the VideoRule by the solution provided by #30
Also I found the class UniversalVideoListener.java is implemented TestNG listener, included the test failure listener and there some code handle the video name, so I tried extended this class and override the method onTestFailure, but finally found the field private IVideoRecordClient videoRecordClient of TestNGListener is private and the interface IVideoRecordClient are also private.
@SergeyPirogov could you kindly provide some advise how I can do ?
Thanks.
Try to use in test:
ITestResult result = Reporter.getCurrentTestResult();
System.setProperty("video.name",
result.getTestClass().getName() + result.getMethod().getMethodName());