18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
SessionState_setVar
Hi,
we have this test.sah:
var $qaEnv = "DEFAULT";
_set($qaEnv,_getGlobal("qaEnv"));
_log($qaEnv);
...
and we are trying to set qaEnv global variable (before running a test.sah) by this URL:
localhost:9999|_s_|dyn|SessionState_setVar?name=qaEnv&value=DEV&isglobal=1&sahisid=2010_09_13__12_46_51__14874046
but when we execute test.sah by this URL:
localhost:9999|_s_|dyn|Suite_start?suite=scripts/test.sah&base=google.com&browser=C:\Program%20Files\Internet%20Explorer\iexplore.exe&threads=3&html=logs/playback&browserProcessName=iexplore.exe&browserOption=-nomerge&sahisid=2010_09_13__12_46_51__14874046
we get this log:
Starting script
_sahi.setServerVar('\$qaEnv', _getGlobal("qaEnv")); at 13.9.2010 15:49:56
null at 13.9.2010 15:49:57
_log(null); at 13.9.2010 15:49:57
Stopping script
So our question is:
Why _getGlobal("qaEnv") returns null?
Is something wrong with our SessionState_setVar URL?
How can we pass a variable to sah/suite this way?
Can anybody please help us with this?
Thanks
Steve
we have this test.sah:
var $qaEnv = "DEFAULT";
_set($qaEnv,_getGlobal("qaEnv"));
_log($qaEnv);
...
and we are trying to set qaEnv global variable (before running a test.sah) by this URL:
localhost:9999|_s_|dyn|SessionState_setVar?name=qaEnv&value=DEV&isglobal=1&sahisid=2010_09_13__12_46_51__14874046
but when we execute test.sah by this URL:
localhost:9999|_s_|dyn|Suite_start?suite=scripts/test.sah&base=google.com&browser=C:\Program%20Files\Internet%20Explorer\iexplore.exe&threads=3&html=logs/playback&browserProcessName=iexplore.exe&browserOption=-nomerge&sahisid=2010_09_13__12_46_51__14874046
we get this log:
Starting script
_sahi.setServerVar('\$qaEnv', _getGlobal("qaEnv")); at 13.9.2010 15:49:56
null at 13.9.2010 15:49:57
_log(null); at 13.9.2010 15:49:57
Stopping script
So our question is:
Why _getGlobal("qaEnv") returns null?
Is something wrong with our SessionState_setVar URL?
How can we pass a variable to sah/suite this way?
Can anybody please help us with this?
Thanks
Steve
Comments
I will have to reproduce and check why this is happening.
We are thinking of adding an "extraInfo" parameter to Suite_start where you can pass custom information. Would that help you?
Regards,
Narayan
thanks for your replay - yes extraInfo parameter to Suite_start will be nice finall solution.
But now we don't have an idea of a workarround, so if you or anybody know one - we really need it.
Thanks
Steve
P.S.: Hm, but SessionState_setVar should work, so I am really interesting to your check.
Once more thanks for your ministry.
anything new or any tips please ?
Anybody have experiences with running sah/suite by SAHI proxy URL (not by *.bat)?
Thanks a lot
Steve
can you reproduce this or is there a SAHI release with extraInfo implemented ?
Thanks for your response.
Steve