Beispiel #1
0
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            if (!IsMouseCaptured)
            {
                if (_bitmap != null)
                {
                    _bitmap.Dispose();
                }
                _bitmap = ScreenShotUtility.Take();

                if (Focus()) // So that we get the Escape key.
                {
                    if (CaptureMouse())
                    {
                        RaisePickingStarted(EventArgs.Empty);
                        _timer.Start();
                    }
                }
            }
            else
            {
                RaiseColorPicked(GetEventArgs());

                _endingCapture = true;
                ReleaseMouseCapture();
                _endingCapture = false;
            }

            base.OnMouseDown(e);
        }
Beispiel #2
0
 public void CheckResult()
 {
     try
     {
         EndTime = DateTime.Now.ToString("yyyyMMddHHmmss");
         watch   = BusinessFlows.watch;
         watch.Stop();
         ElapsedTime  = watch.Elapsed.TotalMinutes.ToString("0.00");
         status       = ScreenShotUtility.CompareScreen();
         errorMessage = BusinessFlows.ErrorMessage;
         if (status != "Failure")
         {
             //status = CompareCsvFile();
         }
         SaveStatusToReport();
     }
     catch (Exception e)
     {
         logger.Fatal("Fail To Check Result.");
         logger.Fatal(e.Message);
     }
     finally
     {
         GoDashboradPage();
     }
 }
Beispiel #3
0
 public void TakeScreenshotForScenarioFailure()
 {
     if (_scenarioContext.TestError != null)
     {
         string title = _scenarioContext.ScenarioInfo.Title;
         ScreenShotUtility.CaptureScreenshot(driver, title);
     }
 }