public String getCommandURLString() {
   StringBuffer sb = new StringBuffer("cmd=");
   sb.append(Urls.urlEncode(command));
   if (args == null) return sb.toString();
   for (int i = 0; i < args.length; i++) {
     sb.append('&');
     sb.append(Integer.toString(i + 1));
     sb.append('=');
     sb.append(Urls.urlEncode(args[i]));
   }
   return sb.toString();
 }
Example #2
0
 private String buildCommandBody(String command) {
   StringBuffer sb = new StringBuffer();
   sb.append(command);
   if (sessionId != null) {
     sb.append("&sessionId=");
     sb.append(Urls.urlEncode(sessionId));
   }
   return sb.toString();
 }
Example #3
0
 // TODO(simon): Revert back to protected once the abstract browser launcher is in the same package
 public static String getDefaultHTMLSuiteUrl(
     String browserURL, String suiteUrl, boolean multiWindow, int serverPort) {
   String url = Urls.toProtocolHostAndPort(browserURL);
   String resultsUrl;
   if (serverPort == 0) {
     resultsUrl = "../postResults";
   } else {
     resultsUrl = "http://localhost:" + serverPort + "/selenium-server/postResults";
   }
   return url
       + "/selenium-server/core/TestRunner.html?auto=true"
       + "&multiWindow="
       + multiWindow
       + "&defaultLogLevel=info"
       + "&baseUrl="
       + Urls.urlEncode(browserURL)
       + "&resultsUrl="
       + resultsUrl
       + "&test="
       + Urls.urlEncode(suiteUrl);
 }
Example #4
0
 // TODO(simon): Reduce visibility once server/browserlaunchers no more
 public static String getDefaultRemoteSessionUrl(
     String startURL,
     String sessionId,
     boolean multiWindow,
     int serverPort,
     boolean browserSideLog) {
   String url = Urls.toProtocolHostAndPort(startURL);
   url +=
       "/selenium-server/core/RemoteRunner.html?"
           + "sessionId="
           + sessionId
           + "&multiWindow="
           + multiWindow
           + "&baseUrl="
           + Urls.urlEncode(startURL)
           + "&debugMode="
           + browserSideLog;
   if (serverPort != 0) {
     url += "&driverUrl=http://localhost:" + serverPort + "/selenium-server/driver/";
   }
   return url;
 }