private static void HandleScreenshots(string screenshotString, string screenshotName, List <Attachment> attachmentList) { if (String.IsNullOrWhiteSpace(screenshotString) || String.IsNullOrWhiteSpace(screenshotName)) { Log.DebugFormat("screnshot not found. name:{0}, content{1}", screenshotName, screenshotString); return; } if (screenshotName.ToLower().EndsWith("rtf")) { //converting rtf to doc to handle IE9 scenario screenshotString = RTFUtil.ConvertRtfToHtml(screenshotString, ref screenshotName); } ScreenshotHandler.Validate(screenshotName, screenshotString); attachmentList.Add(new Attachment { AttachmentName = screenshotName, Attachment1 = screenshotString }); }