Hey Harbhajan, you can use Ashot() to capture full webpage screenshot in Python Selenium Webdriver. AShot() is a webdriver screenshot utility to capture entire page screenshot and is natively supported from Selenium 3 onwards. You can download the jar files for AShot() from here: http://central.maven.org/maven2/ru/yandex/qatools/ashot/ashot/1.5.3/ashot-1.5.3.jar
Following code snippet shows how to use it for capturing full page screenshot:
import java.io.File;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
import ru.yandex.qatools.ashot.AShot;
import ru.yandex.qatools.ashot.Screenshot;
import ru.yandex.qatools.ashot.shooting.ShootingStrategies;
public class EntirePageScreenshot {
public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.chrome.driver", ".\\Driver\\chromedriver.exe");
driver=new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("https://www.amazon.in");
//take screenshot of the entire page
Screenshot screenshot=new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
try {
ImageIO.write(screenshot.getImage(),"PNG",new File("path of the file"));
} catch (IOException e) {
e.printStackTrace();
}
driver.quit();
}
}