Code to take and save screenshot :
public class Sample
{
public static void main (String[] args)
{
*//Initialize Browser*
System.setProperty("webdriver.gecko.driver", "**E:\\path\\to\\geckodriver.exe**");
WebDriver driver = new FirefoxDriv...