protected JSONObject getCapabilityPayload() {
    Capabilities desiredCapabilities = getCapabilities();
    JSONObject payload = new JSONObject();

    try {
      payload.put("desiredCapabilities", new JSONObject(desiredCapabilities.asMap()));
    } catch (JSONException e) {
      throw new SelendroidException(e);
    }
    return payload;
  }
Configuring AndroidServlet to use special test handler.
selendroid-server/src/test/java/io/selendroid/server/BaseTest.java