Ejemplo n.º 1
0
        //  Assertion with three validation
        public static void GetApplicationSnapShot(IWebDriver webdriver, ClientOperatingSystem OperatingSystem, ClientBrowser browser, string uniqueRowIdentifier = null)
        {
            int left, top, width, height;

            // Allow time for all elements on the map to be fully displayed.
            Thread.Sleep(5000);

            // Use calling method to form a unique file name for the baseline data.
            StackTrace stackTrace       = new StackTrace();
            string     uniqueIdentifier = uniqueRowIdentifier + OperatingSystem.ToString() + browser.ToString();
            string     uniqueFileName   = AppCommonUtility.GetUniqueFileName(uniqueIdentifier, stackTrace);


            CreateAppSnap(webdriver, out left, out top, out width, out height);

            // Crop the screenshot and convert it to a snapshot type.
            Rectangle rectangle = new Rectangle(left, top, width, height);
            Snapshot  snapshot  = GetSnapshotOfMap(webdriver);

            CreateSnapShot.AppCreateSnapShot(snapshot, uniqueFileName, rectangle);
        }