18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

"No Script has been set for playback."

DonnaMooresDonnaMoores Members
edited July 2008 in Sahi - Open Source
I have installed Sahi / Java onto a second machine in my work place, and on my home PC.

Sahi installed and ran brilliantly on my home PC and on my first installation.

However on my second installation I am experiencing a problem where
java.lang.NullPointerException
at net.sf.sahi.command.Player.stop(Player.java:55)
at net.sf.sahi.command.Player.stop(Player.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sf.sahi.command.CommandExecuter.execute(CommandExecuter.java:53)
at net.sf.sahi.LocalRequestProcessor.getLocalResponse(LocalRequestProces
sor.java:42)
at net.sf.sahi.ProxyProcessor.processLocally(ProxyProcessor.java:199)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:71)
at java.lang.Thread.run(Unknown Source)
It just doesn't appear to be setting the start page correctly. If in the Sahi controller, on the playback tab I select my file, hit the set button, and then try and view the parsed file, it displays the message
"No Script has been set for playback."
Do you have any suggestions.

Comments

  • Which method are you using for picking scripts for playback?
  • I have been using the Sahi Controller.... still struggling with it...

    Thanks
    Donna
  • Hi,

    Check if everything is in place. I mean proper java version, proxy is set to listen on port 9999, the sahi.bat file is correct etc. Also ensure that the syntax in your script is correct as at times the script doesnt load if there is some syntax error in it.
    Try to run some simple script first.

    Regards,
    Pankaj.
  • Hi,

    Check if everything is in place. I mean proper java version, proxy is set to listen on port 9999, the sahi.bat file is correct etc. Also ensure that the syntax in your script is correct as at times the script doesnt load if there is some syntax error in it.
    Try to run some simple script first.

    Regards,
    Pankaj.
    The java version I am using is update 6 version 7.
    My proxy is listening on port 9999.
    The sahi.bat is as follows:
    SET MOZ_NO_REMOTE=1
    CLS
    java -classpath C:\sqljdbc\enu\sqljdbc.jar;../lib/sahi.jar net.sf.sahi.Proxy
    and the jar files are in the correct location

    and the script is simply:
    _assertExists(_link("Quality Manual[1]"));
    _assertExists(_link("SourceSafe AuditLog Viewer"));
    _click(_link("SourceSafe AuditLog Viewer"));
    which is exactly as it was recorded.

    I have got the source now on my machine and I am debugging, but I am not an expert in java code, so I am struggling a bit.

    What I have found is that on my machine that works in player.java
    public HttpResponse currentScript(HttpRequest request) {
            Session session = request.session();
            SahiScript script = session.getScript();
            if (script != null) {
                return new Script().view(script.getFilePath());
            } else {
                return new SimpleHttpResponse(
                        "No Script has been set for playback.");
            }
        }
    
    the variable "script" gets populated with the values I am expecting.

    However on the machine that isn't working the variable "script" is set to null

    I am struggling to get to the bottom of this problem.

    Does anyone have anymore suggestions of things I can try

    Many thanks

    Donna
  • rksrks Members
    Looking at the chunk of code you posted, it seems that java code is making use of some session (most likely an HTTP session). Check if your browser settings allows for cookies as cookies is the most common mechanism for maintaining session between sessionless http requests.
  • Hi Guys

    I am getting , inspite of starting proxy . our Office proxy may be the culprit ... but we have to leave with it,
    How to work in office proxy?

    error:Playback session not started. Verify that proxy is set on the browser.
    at net.sf.sahi.client.Browser.executeStep(Browser.java:205)
    at net.sf.sahi.client.Browser.navigateTo(Browser.java:157)
    at net.sf.sahi.client.Browser.navigateTo(Browser.java:146)
    at com.mformation.modules.sso.usertab.example.testGoogle(example.java:14)
    at com.mformation.modules.sso.usertab.example.Startmethod(example.java:9)
    at com.mformation.utils.RunGUIRegression.main(RunGUIRegression.java:21)
    Sep 1, 2010 11:16:54 AM net.sf.sahi.test.ProcessHelper kill
    INFO: Kill: [2208]
  • narayannarayan Administrators
    Hi dlohith,

    You will need to specify the browser to use Sahi as its proxy, and ask Sahi to use your office proxy.
    After setting the browser proxy settings to localhost 9999, follow the instructions here: http://sahi.co.in/w/configuring-an-external-proxy

    Regards,
    Narayan
Sign In or Register to comment.