Closed amuthansakthivel closed 3 years ago
This has been now implemented in a way where users can pass any custom capability in the se:options
block, and then this information will be saved in a directory structure which will contain a directory named with the sessionId, and inside it you'll find the video and the session capabilities.
Have a look at https://github.com/SeleniumHQ/docker-selenium#video-recording-screen-resolution-and-time-zones-in-a-dynamic-grid
@diemol Could you give an example how to do that in Java or Python?
@diemol The question asks how to give a name for video file but the test code you indicate just makes the video recording option on. Is there a way to give a name for video file?
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
🚀 Feature Proposal
For now the video name is passed as an environment variable to the image - selenium/video:ffmpeg-4.3.1-20200920 Can we have this passed from the desired capabilities with key as "videoName" and value as "myfirstdockerseleniumtest". Now the video generated in the /video directory should be named as myfirstdockerseleniumtest.mp4 If this parameter is not passed then it should generate a random name or timestamp to generate the filename for the video generated.
Motivation
It will make job easy for test engineers to differentiate the videos generated from the containers with the customized test name. Generating the video with the same name would override the existing videos in the /video directory.
Example
Sample java code : DesiredCapabilities cap= new DesiredCapabilities(); cap.setBrowserName(browser); cap.setCapability("videoName", "myfirstdockerseleniumtest"); driver = new RemoteWebDriver(new URL("http://13.126.125.68:4444/wd/hub"),cap); driver.manage().window().maximize(); driver.get("https://google.com"); System.out.println(driver.getTitle()); driver.quit();