Desktop Capture
Posted: Sun Apr 14, 2019 10:28 am
Hello,
I want to capture desktop screenshot frequently during my automation execution and save it in a particular folder. My code is all working except the one to capture the desktop which is the below.
Image img = Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Desktop.CaptureImage();
img.Save(_path, System.Drawing.Imaging.ImageFormat.Jpeg);
The first code is not working even though I have added the proper reference. It says
Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Playback, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Is there a way to solve this? Or can you provide me an alternate code just to capture the full desktop?
Thanks in advance
I want to capture desktop screenshot frequently during my automation execution and save it in a particular folder. My code is all working except the one to capture the desktop which is the below.
Image img = Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Desktop.CaptureImage();
img.Save(_path, System.Drawing.Imaging.ImageFormat.Jpeg);
The first code is not working even though I have added the proper reference. It says
Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Playback, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Is there a way to solve this? Or can you provide me an alternate code just to capture the full desktop?
Thanks in advance