Noksa / WebDriver.Screenshots.Extensions

C# WebDriver screenshots extensions, like a screenshot entire page
MIT License
12 stars 9 forks source link

System.OverflowException: 'Arithmetic operation resulted in an overflow.' #12

Closed kumarmageshr closed 5 years ago

kumarmageshr commented 5 years ago

Please find the code

             IWebDriver driver;
            driver = new ChromeDriver(System.IO.Directory.GetCurrentDirectory() + "\\driver");
            driver.Url = "http://www.seleniumstutorial.com/taking-screenshot-using-c-selenium/";

            var scMaker = new ScreenshotMaker();
            var cutFooterDecorator = new CutterDecorator(scMaker);
            cutFooterDecorator.SetCuttingStrategy(new CutElementHeightOnEntireWidthThenCombine(By.Id("footer")));
            var vcd = new VerticalCombineDecorator(cutFooterDecorator);
            var screenArrBytes = driver.TakeScreenshot(vcd);

While excute above code in TakeScreenshot return following error. "Arithmetic operation resulted in an overflow."

kumarmageshr commented 5 years ago

Can you check below Url also. https://edition.cnn.com/entertainment

This is different one Error Message: "OpenQA.Selenium.WebDriverException: 'Script returned a value, but the result could not be cast to the desired type'"

Noksa commented 5 years ago

@kumarmageshr Confirmed. This is a bug (first test-case).

Noksa commented 5 years ago

@kumarmageshr

Can you check below Url also. https://edition.cnn.com/entertainment

Can you please give more info about this error? Browser/resolution/code.

kumarmageshr commented 5 years ago

@kumarmageshr

Can you check below Url also. https://edition.cnn.com/entertainment

Can you please give more info about this error? Browser/resolution/code.

URL : https://edition.cnn.com/entertainment While running the above page its return below.

Error Message: "OpenQA.Selenium.WebDriverException: 'Script returned value, but the result could not be cast to the desired type'"

Noksa commented 5 years ago

@kumarmageshr Please, provide a code which throws error. At this page I can’t find element with Id “footer”.

kumarmageshr commented 5 years ago

@kumarmageshr Please, provide a code which throws error. At this page I can’t find element with Id “footer”.

I didn't provide footer id.. without footer id can we use it ?

Noksa commented 5 years ago

@kumarmageshr In this case, I do not understand what kind of error you are talking about. What code causes an error? Without the code, I can not help, because I do not understand how to reproduce error. I fixed first bug, the question is about the CNN site.