示例#1
0
        private static void TakeScreenshotIfTestFails()
        {
            string screenshotFolder = AppDomain.CurrentDomain.BaseDirectory + @"\screenshots";

            Directory.CreateDirectory(screenshotFolder);
            var screen = DriverSingleton.GetDriver().TakeScreenshot();

            screen.SaveAsFile(screenshotFolder + @"\screenshot" + DateTime.Now.ToString("yy-MM-dd_hh-mm-ss") + ".png",
                              ScreenshotImageFormat.Png);
        }
示例#2
0
        public override BasePage OpenPage()
        {
            DriverSingleton.GetInstance().Navigate().GoToUrl(PageUrl);

            return(this);
        }
示例#3
0
 public void OpenBrouser()
 {
     driver = DriverSingleton.GetDriver();
 }
示例#4
0
 public void CloseBrouser()
 {
     DriverSingleton.CloseDriver();
 }