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.
Storing Global variables to be used by suite of tests
I need to be able to Store my Global Variables in an external file so it is available for my suite of tests. Could someone tell me how I can accomplish it.
Thanks
Thanks
Comments
RR
Another idea can be to use _debugToFile() to store the required variable in a file and use _readFile() to read those variables from that file.
Or you can also use the database (excel would be a simple choice) to enter and retrieve variables.
Regards,
Pankaj.
When you say you want to "store" do you mean you have a fixed set of common static constants or do you mean being able to store and retrieve global variables within tests in a suite?
To just keep a few constants, like say ids of controls, you can just put it in a sahi file and include it in your other scripts.
Eg. To store a value from one script in a suite and use it in another script in that suite, use
_setGlobal(<key>, <value>);
and
_getGlobal(<key>);
Eg. -Narayan