You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class IndiaTimes {
public static void main(String[] args) throws IOException, InterruptedException {
WebDriver wd = new SafariDriver();
wd.get("http://www.indiatimes.com");
Thread.sleep(5000);
((JavascriptExecutor) wd).executeScript("$('#wrap header').hide();");
Thread.sleep(500);
WebElement we = wd.findElement(By.cssSelector("#hp_block_2"));
final Screenshot screenshot = new AShot()
.shootingStrategy(new ViewportPastingStrategy(1500))
.takeScreenshot(wd, we);
final BufferedImage image = screenshot.getImage();
ImageIO.write(image, "PNG",
new File(System.getProperty("user.home") + "/AShot_indiatimes.png"));
}
}
@abhishekkyd@pazone@frolovs I am using the code that you are suggesting that it will work for safari, but it is not working for me on safari... I have attached the screenshot I obtained using the code above... please provide any configuration i need for Safari and IE.
I am new sorry if i ask some silly question or use inappropriate words...
thank you
The text was updated successfully, but these errors were encountered:
public class IndiaTimes {
public static void main(String[] args) throws IOException, InterruptedException {
WebDriver wd = new SafariDriver();
wd.get("http://www.indiatimes.com");
Thread.sleep(5000);
((JavascriptExecutor) wd).executeScript("$('#wrap header').hide();");
Thread.sleep(500);
WebElement we = wd.findElement(By.cssSelector("#hp_block_2"));
final Screenshot screenshot = new AShot()
.shootingStrategy(new ViewportPastingStrategy(1500))
.takeScreenshot(wd, we);
final BufferedImage image = screenshot.getImage();
ImageIO.write(image, "PNG",
new File(System.getProperty("user.home") + "/AShot_indiatimes.png"));
}
}
@abhishekkyd @pazone @frolovs I am using the code that you are suggesting that it will work for safari, but it is not working for me on safari... I have attached the screenshot I obtained using the code above... please provide any configuration i need for Safari and IE.
I am new sorry if i ask some silly question or use inappropriate words...
thank you
The text was updated successfully, but these errors were encountered: