Esempio n. 1
0
        private void getRemoteScreenshot(ScreenShotRemoteWebDriver theWebDriver,
                                         String browser, String version, String stringURL)
        {
            Screenshot screenshot = theWebDriver.GetScreenshot();

            screenshot.SaveAsFile(screenshotPath + browser + "_" + version + "_" + stringURL + ".jpeg", ImageFormat.Jpeg);
        }
Esempio n. 2
0
        public void SaveScreenshot(string baseImage, string currentImage, ImageFormat format)
        {
            var duration = new Stopwatch();

            // WaitCallback 5 seconds before shot
            Thread.Sleep(TestConstants.ScreenShotDelay);
            duration.Start();
            _driver.GetScreenshot().SaveAsFile(currentImage);
            if (!Tools.CheckImageExist(baseImage))
            {
                // Save base line screenshot file
                _driver.GetScreenshot().SaveAsFile(baseImage);
            }
            Log.Info(MethodBase.GetCurrentMethod().Name + TestConstants.Sp + duration.ElapsedMilliseconds + TestConstants.Ms);
            duration.Stop();
        }