}
}
private void performPageDump(GalenArguments arguments) throws Exception {
SeleniumBrowserFactory browserFactory = new SeleniumBrowserFactory();
Browser browser = browserFactory.openBrowser();
try {
if (arguments.getUrl() == null || arguments.getUrl().isEmpty()) {
throw new SyntaxException("--url parameter is not defined");
}
if (arguments.getPaths() == null || arguments.getPaths().size() == 0) {
throw new SyntaxException("You should specify a spec file with which you want to make a page dump");
}
if (arguments.getExport() == null || arguments.getExport().isEmpty()) {
throw new SyntaxException("--export parameter is not defined");
}
if (arguments.getScreenSize() != null) {
browser.changeWindowSize(arguments.getScreenSize());
}
browser.load(arguments.getUrl());
Galen.dumpPage(browser, arguments.getUrl(), arguments.getPaths().get(0), arguments.getExport(), arguments.getMaxWidth(), arguments.getMaxHeight());
System.out.println("Done!");
}
catch (Exception ex) {
throw ex;
}
finally {
browser.quit();
}
}