Guest User

Untitled

a guest
Jan 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. //Make Screenshot of Client Setup
  2. OutputHandler.ColorCMDOutput(" + Make a Screenshot",
  3. ConsoleColor.Gray);
  4. Process makeScreenshot = new Process();
  5. makeScreenshot.StartInfo.FileName = screenShotTool;
  6. makeScreenshot.StartInfo.Arguments = "/f "" + testResult + "\Screenshots\" + screenShotName + ".png"";
  7. makeScreenshot.StartInfo.UseShellExecute = false;
  8. makeScreenshot.StartInfo.RedirectStandardError = true;
  9. makeScreenshot.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  10. makeScreenshot.Start();
  11.  
  12. //Start StreamReader
  13. StreamReader myStreamReader = makeScreenshot.StandardError;
  14. string error = makeScreenshot.StandardError.ReadToEnd();
  15.  
  16. //Read the standard error
  17. OutputHandler.AppendDataToFile(buglist, error);
  18.  
  19. makeScreenshot.WaitForExit();
  20. makeScreenshot.Dispose();
Add Comment
Please, Sign In to add comment