SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

IEDriver: Screenshot of iframe not sized correctly #7178

Open lukeis opened 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 7178

When taking a screenshot when the focus is switched to an iframe, the screenshot is
not sized correctly and results it a large portion of the iframe being cutoff from
the screenshot.

Selenium version: 2.41
OS: Win7 x64
Browser: IE9 x32

I setup a reproducible example that contains an iframe.  When the screenshot of the
page is taken, the full page is captured.  However, when focus is switched to the iframe,
only a portion of the iframe is captured by the screenshot.

Attached is the html for the page and iframe, along with the images resulting from
a screenshot of the page and the iframe.

IWebDriver driver = new InternetExplorerDriver();
driver.Navigate().GoToUrl("iframe_test.html");

driver.SwitchTo().Frame(0);

Screenshot screenshot = ((ITakesScreenshot)driver).GetScreenshot();
screenshot.SaveAsFile(@"c:\screenshot.png", ImageFormat.Png);

The expected result is that the entire iframe would be captured by the screenshot.

Reported by nathandace on 2014-04-04 15:03:53


lukeis commented 8 years ago

Reported by barancev on 2014-04-08 12:57:42

lukeis commented 8 years ago
we also observed same issue, when it capturing screen shot, screen is minimizing and
taking the screen shot please assist how can we resolve this issue?
check the attached screen shot.

*********we are using the below code**************
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
String path = "C:\\automation\\Stpe2_2_1.png";
FileUtils.copyFile(scrFile, new File(path));

*******************************

Reported by siva.tiruvuru on 2014-05-14 22:19:12


lukeis commented 8 years ago
Please post the solution to kirankumar.maddi@gmail.com when resolved thanks

Reported by kirankumar.maddi on 2014-06-25 07:20:31

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 17:46:34