To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/aAmJ18tSWQgJ.--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/W49MtxBsirwJ.
import java.net.URL;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.Augmenter;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
public class Testing {
private WebDriver getScreenshot() throws MalformedURLException, InterruptedException
{
WebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444/wd/hub"),DesiredCapabilities.firefox());
driver.get("http://www.angelfire.com/super/badwebs/");
return new Augmenter().augment(driver);
} // getScreenshot
public void myTest() throws Exception {
WebDriver augmentedDriver = getScreenshot();
File screenshot = ((TakesScreenshot)augmentedDriver).
getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshot, new File("c:\\tmp\\screenshot1.png"));
}
}
Thanks & Regards,