I know below code takes a screenshot of the page. But what is the different if i create a DesiredCapabilities instance and associate this capability to driver to take a screenshot? I am not getting why DesiredCapabilities are used for, though i have gone through some sites. Can someone explain in layman terms please? Why to set capabilities of platform, browserName, version?
WebDriver driver=new FirefoxDriver();
driver.get("http://www.google.com");
File srcFile=((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(srcFile, new File("d:\\Screenshot.png"));
driver.close();