Skip to content

bharathkumar-gopalan/grid-video-recorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grid-video-recorder

PLEASE NOTE THAT THIS HAS BEEN TESTED IN SELENIUM 2.X , SELENIUM 3.X COULD HAVE BREAKING CHANGES , The Idea is same though

Grid Video recorder :

This extension enables to do a video recording of running test cases in a selenium grid , For demonstration purpose it has a Screen recorder that uses Monte Media library (https://www.randelshofer.ch/monte/) to create .mov files of the test automation running in selenium node . To view the licenseing information of the monte media library please refer to https://www.randelshofer.ch/monte/license.html

Configuration Steps

  • Create a new folder (for example named recorder)
  • Download the jar (grid-video-recorder.jar) into the folder(recorder)
  • Download the selenium standalone server .jar into the folder(recorder)
  • Download monte media library jar file from https://www.randelshofer.ch/monte/ into the folder (recorder)
  • launch the selenium hub with the following command "java -cp *:. org.openqa.grid.selenium.GridLauncher -role hub"
  • launch the selenium node with the following command "java -cp *:. org.openqa.grid.selenium.GridLauncher -role node -proxy io.nirvagi.utils.node.proxy.ScreenRecordingProxy -servlets io.nirvagi.utils.servlet.RecorderServlet"

Calling the recorder in the client code

The recorder uses two desired capabilities node_screen_recording which must be set to true to enable recording . By default the recorder stops recording after 180 seconds . This can be configured with the desired capabiliy node_recording_timeout. The following example in java demonstrates how to use the recorder

public static void main(String args[]) throws Exception{
		DesiredCapabilities caps = DesiredCapabilities.firefox();
		// Enable screen recording 
		caps.setCapability("node_screen_recording", true);
		// Set the recorder timeout to 60 seconds, The Screen recording will be stopped after 60 seconds
		caps.setCapability("node_recording_timeout", 60);
		RemoteWebDriver d = new RemoteWebDriver(new URL("https://localhost:4444/wd/hub"), caps);
		d.get("https://www.google.com");
		// Your screen recording would have ended here 
		d.quit();		
	}

The recording can be viewed by accessing the node (For example assuming that the node is running in localhost , the video files can be viewed at localhost:5555/extra/RecorderServlet)

Points to remember

  • The recording happens at OS level , So if two test sessions are run parallely in the same node, The first session to start the recording will get handle to the recorder and will be able to stop it
  • If the browser is minimized, due to some reason the recording cannot capture what is happening

About

A video recording solution for Selenium grid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages