public void TryScreenshotImageFormat() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); SeleniumUtilities.CaptureScreenshot(this.WebDriver, this.TestObject); string filePath = Path.ChangeExtension(((IFileLogger)this.Log).FilePath, SeleniumUtilities.GetScreenShotFormat().ToString()); Assert.IsTrue(File.Exists(filePath), "Fail to find screenshot"); Assert.AreEqual(Path.GetExtension(filePath), "." + SeleniumUtilities.GetScreenShotFormat().ToString(), "The screenshot format was not in correct Format"); File.Delete(filePath); }
public void GetImageFormatFromConfig() { Assert.AreEqual(ScreenshotImageFormat.Png, SeleniumUtilities.GetScreenShotFormat(), "The Incorrect Image Format was returned, expected: " + Config.GetGeneralValue("ImageFormat")); }
public void CaptureScreenshotNoExistingDirectory() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); string screenShotPath = SeleniumUtilities.CaptureScreenshot(WebDriver, TestObject, "TempTestDirectory", "CapScreenShotNoDir", SeleniumUtilities.GetScreenShotFormat()); Assert.IsTrue(File.Exists(screenShotPath), "Fail to find screenshot"); File.Delete(screenShotPath); }
public void CaptureScreenshotNoExistingDirectoryDeprecated() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); #pragma warning disable CS0618 // Type or member is obsolete string screenShotPath = SeleniumUtilities.CaptureScreenshot(WebDriver, "TempTestDirectory", "OldCapScreenShotNoDir", SeleniumUtilities.GetScreenShotFormat()); #pragma warning restore CS0618 // Type or member is obsolete Assert.IsTrue(File.Exists(screenShotPath), "Fail to find screenshot"); File.Delete(screenShotPath); }