public JSONObject next() throws JSONException {
    JSONObject action = actionChain.getJSONObject(index++);
    String actionName = action.getString("name");
    if (actionName.equals(TouchActionName.PAUSE)) {
      pauseTime = action.getInt("ms");
    }
    else {
      pauseTime = 0;
    }
    return action;
  }
Class to iterate over JSON action chains
selendroid-server/src/main/java/io/selendroid/server/action/ActionChain.java