public void captureEntirePageScreenshot(String filename) { browser.doCommand("captureEntirePageScreenshot", new String[] {filename}); } }
public void captureScreenshot(String filename) { browser.doCommand("captureScreenshot", new String[] {filename}); }
public String getString(String commandName, String[] args) { String result = doCommand(commandName, args); if (result.length() >= "OK,".length()) { return result.substring("OK,".length()); } System.err.println("WARNING: getString(" + commandName + ") saw a bad result " + result); return ""; }
public String doCommand(String commandName, String[] args) { String output = httpCommandProcessor.doCommand(commandName, args); return removeStatusCode(output); }
public void stop() { if (hasSessionInProgress()) { doCommand("testComplete", null); } setSessionInProgress(null); }
public void run(SeleniumTest test) { int processedCommands = 0; try { for (SeleniumTest.Element element : test.elements()) { if (element instanceof SeleniumTest.Command) { SeleniumTest.Command command = (SeleniumTest.Command)element; log.debug("original command: {}", command); if (!command.getName().equals("pause")) { browser.doCommand(command.getName(), new String[] {command.getTarget(), command.getValue()} ); } else { try { Thread.sleep(Long.parseLong(command.getTarget())); } catch (NumberFormatException e) { log.warn("invalid argument for pause command: {}", command.getTarget()); throw new SeleniumException(e); } catch (InterruptedException e) { log.warn("pause command interrupted", e); } } ++processedCommands; } } } catch (SeleniumException e) { throw new SeleniumTestFailureException(e, test, processedCommands); } }
return proc.doCommand(command, locatorArg);