Package net.sf.sahi.playback

Examples of net.sf.sahi.playback.SahiScript


  }

    private String getScriptPath(final Session session) {
        RhinoScriptRunner scriptRunner = (RhinoScriptRunner) session.getScriptRunner();
        if (scriptRunner == null) return "";
        SahiScript script = scriptRunner.getScript();
    if (script == null) {
            return "";
        }
        return Utils.escapeDoubleQuotesAndBackSlashes(script.getFilePath());
    }
View Full Code Here


      String scriptPath = session.getVariable("sahi_scriptPath");
      stop(request);
      setScript(session, scriptPath);
    }
    private void setScript(Session session, String scriptPath){
        SahiScript script = new ScriptFactory().getScript(scriptPath);
        RhinoScriptRunner scriptRunner = new RhinoScriptRunner(script);
    session.setScriptRunner(scriptRunner);
        startPlayback(session, true, "1");
    }
View Full Code Here

        scriptRunner.markStepInProgress(request.getParameter("stepId"), ResultType.getType(type));
    }

    public HttpResponse currentScript(final HttpRequest request) {
        Session session = request.session();
        SahiScript script = getScript(session);
        if (script != null) {
            return new Script().view(script.getFilePath());
        } else {
            return new SimpleHttpResponse(
                    "No Script has been set for playback.");
        }
    }
View Full Code Here

    }

    public HttpResponse getBrowserScript(final HttpRequest request) {
        HttpResponse httpResponse;
        String scriptPath = request.getParameter("href");
        SahiScript script = new ScriptFactory().getScript(scriptPath);
    if (script != null) {
            httpResponse = new SimpleHttpResponse(LogViewer.highlight(script.getBrowserJSWithLineNumbers(), getLineNumber(request)));
        } else {
            httpResponse = new SimpleHttpResponse(
                    "No Script has been set for playback.");
        }
        return httpResponse;
View Full Code Here

TOP

Related Classes of net.sf.sahi.playback.SahiScript

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.