public String doCommand(String commandName, String[] args) { DefaultRemoteCommand command = new DefaultRemoteCommand(commandName,args); String result = executeCommandOnServlet(command.getCommandURLString()); if (result == null) { throw new NullPointerException("Selenium Bug! result must not be null"); } if (!result.startsWith("OK")) { return throwAssertionFailureExceptionOrError(result); } return result; }