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.
how to pass parameter values thro runtime
Actually am running a suite through commandline. The script i use has a funciton, can i be able to pass the parametes to the function during runtime(i.e) in command line???
if so, how????
if so, how????
Comments
Only by means of _callServer?
Regards,
Narayan
httx://sahi.example.com/_s_/dyn/Player_auto2?file=" + file + "&startUrl=" + startUrl + "&p:paramName=03.04.2005"
with the value "03.04.2005" accessible from scripts by means of
date = _ARGS["paramName"]
could be just fine.
Suites could look in similar way:
test1.sah /startPageForTest1.jsp p:paramName=03.04.2005
Thank you,
Alexander
Just a quick one to ask if you had a chance to implement this? It would be ideal for the current set of tests I have
Cheers,
Les.
Set a system property just before you invoke your suite, and then read the variable in your script like this:
In your runsuite.bat
In your script
Would that work for you?
Or you can pass the param to Java using -D
java -DMY_VAR=abcd net.sf...
and access it using
Thanks for the response. Using environment variables or the Java -D flag would certainly work (thanks) and do make things easier. It would be ideal to be able to pass a parameter into each script in a suite, but what you suggested gets me a step closer to what I want and does help a lot
Cheers,
Les.