Answer the question
In order to leave comments, you need to log in
How to take a screenshot of a graphic file (svg, png, etc.) opened in firefox using selenium and geckodriver?
Good day to all!
I ran into one problem, namely, I can’t take a screenshot of an open graphic file (be it svg, png, etc.) in firefox using geckodriver and selenium. If you open a regular web page and execute the code below, everything is fine, but if you do the same for an svg file opened in the browser, then an empty file is returned. If anyone has encountered this problem in geckodriver, tell me which way to dig?
public class Screenshot {
public static void main(String[] args) throws IOException {
FirefoxDriver driver = new FirefoxDriver();
driver.get("http://yahoo.com");
driver.manage().window().maximize();
File scrFile = driver.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("d:\\Selenium\\screenshot2.png"));
}
}
Answer the question
In order to leave comments, you need to log in
Give them a margin.
For example . https://getbootstrap.com/docs/4.3/utilities/spacing/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question