System.out.println(states);
request.session().setXHRReadyStatesToWaitFor(states);
}
public HttpResponse execute(final HttpRequest request) {
Session session = request.session();
Properties props = new Properties();
props.setProperty("sessionId", session.id());
props.setProperty("isWindowOpen", "" + session.isWindowOpen());
props.setProperty("isSahiPaused", "" + session.isPaused());
props.setProperty("isSahiPlaying", "" + session.isPlaying());
props.setProperty("isSahiRecording", "" + session.isRecording());
props.setProperty("hotkey", "" + Configuration.getHotKey());
props.setProperty("interval", "" + Configuration.getTimeBetweenSteps());
props.setProperty("onErrorInterval", "" + Configuration.getTimeBetweenStepsOnError());
props.setProperty("maxRetries", "" + Configuration.getMaxReAttemptsOnError());
props.setProperty("maxWaitForLoad", "" + Configuration.getMaxCyclesForPageLoad());
props.setProperty("strictVisibilityCheck", "" + Configuration.isStrictVisibilityCheckEnabled());
props.setProperty("waitReadyStates", getXHRReadyStatesToWaitFor(session));
props.setProperty("controllerMode", "" + Configuration.getControllerMode());
props.setProperty("escapeUnicode", "" + Configuration.getEscapeUnicode());
props.setProperty("commonDomain", "" + Configuration.getCommonDomain());
props.setProperty("chromeExplicitCheckboxRadioToggle", "" + Configuration.getChromeExplicitCheckboxRadioToggle());
props.setProperty("ignorableIdsPattern", Configuration.getIgnorableIdsPattern());
props.setProperty("strictVisibilityCheck", "" + session.getVariable("strictVisibilityCheck"));
props.setProperty("isSingleSession", "" + session.getVariable("isSingleSession"));
String waitCondition = session.getVariable("waitCondition");
if (Utils.isBlankOrNull(waitCondition)) {
waitCondition = "";
}
props.setProperty("waitCondition", "" + Utils.escapeDoubleQuotesAndBackSlashes(waitCondition));
String waitTime = session.getVariable("waitConditionTime");
if (Utils.isBlankOrNull(waitTime)) {
waitTime = "-1";
}
props.setProperty("waitConditionTime", "" + waitTime);
props.setProperty("stabilityIndex", "" + Configuration.getStabilityIndex());
ScriptRunner scriptRunner = session.getScriptRunner();
if (scriptRunner != null && scriptRunner.getScript() != null){
props.setProperty("scriptPath", Utils.escapeDoubleQuotesAndBackSlashes(Utils.escapeDoubleQuotesAndBackSlashes(scriptRunner.getScript().getFilePath())));
props.setProperty("scriptName", scriptRunner.getScriptName());
}else{
props.setProperty("scriptPath", "");