Saving Screenshot to Disk | Selenium Webdriver Tutorial with c# |Selenium C# training
20% Discount Offer Avail now

Selenium C# Training Forum

Saving Screenshot to Disk

D
Dan Good Post on 06/02/2019

Evening,

 

I cannot seem to save a screenshot to disk despite trying several suggested online solutions.  I am using a Windows 10 VM running Visual Studio C# Community 2017 on my mac.

 

            // ITakesScreenshot screenshotDriver = driver as ITakesScreenshot;

            //Screenshot screenshot = screenshotDriver.GetScreenshot();

            //screenshot.SaveAsFile("c:\\screenshot.png", ImageFormat.Png);

 

            Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();

            ss.SaveAsFile("C:\\sample.png", System.Drawing.Imaging.ImageFormat.Png);

G

Instructor

gunjan Reply on 09/02/2019

Can you please send the zip file of the code

D
Dan Good Reply on 09/02/2019

Apologies Gunjan,

discovered last week this was a user access privileges issue.

Thanks very much for getting back to me.

kind regards,

 

 

Dankel