Video Recording in Selenium using C#

The below code can be used to record the video of the actions done by Selenium till the point of failure or you can record the entire testcase that is being executed by Selenium

 

//Before WebDriver is initialized 
scj = new ScreenCaptureJob();
string title = ScenarioContext.Current.ScenarioInfo.Title;
string Runname = title + DateTime.Now.ToString("yyyy-MM-dd-HH_mm_ss");
scj.OutputScreenCaptureFileName = @"J:\Recording\"+Runname+".wmv";
scj.Start();

//After failure
 scj.Stop();

//If there is no failure and if the testcase is a pass
scj.Dispose

 

You may also like...