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.
Get folder name of playback logs
Hi,
Anyone has an idea how to get the folder name of the current playback script?
The folder name has a pattern of <script_name>(underscore)<browser_name>(2 underscores)<date>(2 underscores)<time>
Here is my solution:
[list=*]
[*]get the script name by using _scriptName()[/*]
[*]for the date and time, will use date-time jscript functions[/*]
[/list]
My only problem is how to get the browser name which is defined in browser_types.xml
Is there any other solution?
Thanks and regards.
Anyone has an idea how to get the folder name of the current playback script?
The folder name has a pattern of <script_name>(underscore)<browser_name>(2 underscores)<date>(2 underscores)<time>
Here is my solution:
[list=*]
[*]get the script name by using _scriptName()[/*]
[*]for the date and time, will use date-time jscript functions[/*]
[/list]
My only problem is how to get the browser name which is defined in browser_types.xml
Is there any other solution?
Thanks and regards.
Comments
evaluate _sahi.getDiagnostics() to get the browser name
Regards
Wormi
The browser name i'm referring to is the from the <name> in browser_types.xml because, i think, that's what Sahi uses for concatinating the browser name in the playback folder and also for displaying the browser name in the logs.
Maybe, there is another solution for getting the full folder name than in what i'm doing??
Thanks and regards.
or you could change the sahi source net.sf.sahi.TestRunner and htdocs/spr/concat.js and implement an _getBrowserType API
Thanks for the quick reply globalworming.
Where can i find the sahi source??
Thanks and regards.
Regards
Wormi
Will check on it.
Anyways, seems i found the answer to my question but, i still have some problem.
Returned evaluation on _sahi.browserType is correct but, i somehow can't save the output in a variable.
Any thoughts how i could save the value in a variable?
Thanks and regards.
Cool. It worked!
Seems that, _set is not working in evaluate.
I first tried _set($browserType, _sahi.browserType); and returns an error but when i include in my script, it returns a value.
Weird.haha
Anyway, thanks for your help Wormi.