Are there any good examples of how to take a screenshot in selenium webdriver C#, then crop and save the image?
I've been searching for some good examples of how to take a screenshot using ITakesScreenshot in Selenium Webdriver in C#, then to crop the image using the elements dimensions and then saving this new image. With no such luck have I found any in C#. I have this method at the moment but every so often I get a Out of Memory exception when used in a test. It fails on the line where it tries to crop. public void TakeScreenShotOfElement(IWebDriver _driver, string rootpath, string imgName, string element2) { string element3 = element2; var element = driver.FindElement(By.XPath(element3)); Byte[] ba