public void FullPageScreenshotWithCssStitching()
 {
     Eyes.ForceFullPageScreenshot = true;
     Eyes.StitchMode = StitchModes.CSS;
     GoToPricingPage();
     Eyes.Open(Driver, AppName, TestCaseName, Resolution1080P);
     Javascript.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");
     Eyes.Check("CssStitching", Target.Window().Fully());
 }
예제 #2
0
        private void ChangeToEuroAndUpdateColor()
        {
            //take the first element with class name et_pb_sum and update the value to what's specified
            Javascript.ExecuteScript(
                "document.getElementsByClassName('et_pb_sum')[0].innerText = \"€0\";");
            var element = Driver.FindElement(By.TagName("h1"));

            //Executes some javascript that updates the color of the h1 element on the page to the color specified
            Javascript.ExecuteScript(
                "arguments[0].setAttribute('style', 'color:#f9ca33!important')", element);
        }
        private void UpdateSubheadingAndCurrency()
        {
            var subheadingElement = Driver.FindElement(SubheaderLocator);

            //Update the subheader text to common visual validation problems
            Javascript.ExecuteScript(
                $"arguments[0].textContent=" +
                $"\"These are the best plans amongst all companie's in the world\"", subheadingElement);
            //take the first element with class name et_pb_sum and update the value to what's specified
            Javascript.ExecuteScript(
                "document.getElementsByClassName('et_pb_sum')[0].innerText = \"USD 0\";");
        }
 private void ScrollToTopOfPage()
 {
     //This will scroll to the top of the page and wait one second
     Javascript.ExecuteScript("window.scrollTo(0, -document.body.scrollHeight)");
     Thread.Sleep(1000);
 }
 private void ScrollToBottomOfPage()
 {
     //This will scroll to the bottom of the page and wait for 1 second for the action to finish
     Javascript.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)");
     Thread.Sleep(1000);
 }