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.
Can scripts that read data from a CSV file be run in a batch in Sahi
Being a semi-technical tester, sahi has been a blessing and does most of the job itself.For one of the initiatives I am currently working on I am required to run all my scripts overnight.The concern is that all my scripts are data-driven and read the test data from a CSV file however when I try running these scripts in a batch, the browser shuts down stating a failure.Can scripts that read data from a CSV file be run in a batch in Sahi? Any help will be greatly appreciated.
Thanks and regards,
Swetha
Thanks and regards,
Swetha
Answers
Firstly, thanks for these words of appreciation for our tool.
Please let me know the following regarding your issue:
1) What do you get in the logs after the failure?
2) Please copy paste what you see on the testrunner console.
3) If there is an error of any sort on the Sahi console, please provide that as well.
Regards.
Many thanks for your timely response.The first script within the test suite that I am attempting to run is not data driven (basic login) and it works fine , the failure occurs when it picks up the second script which is data driven.I can confirm the absolute URL is correct and hence do not see an issue with it however just fyi, the CSV files where these scripts pick up data from are stored on my desktop and not within any of the Sahi files,not sure if this could be an issue.The failure message is as below.
C:\Users\Swetha\sahi\userdata\bin>testrunner.bat
"Usage: testrunner.bat <sah file|suite file> <startURL> <browserType>"
"File path is relative to userdata/scripts"
"Example:"
"testrunner.bat demo/demo.suite http://sahi.co.in/demo/ firefox"
"testrunner.bat demo/sahi_demo.sah http://sahi.co.in/demo/ ie"
C:\Users\Swetha\sahi\userdata\bin>testrunner.bat RegressionTest.suite http://XXXXXX.XXXXXX.co.uk/Login.aspx firefox
test=scripts/RegressionTest.suite
browserType=firefox
baseURL=http://XXXXXX.XXXXXX.co.uk/Login.aspx
host=localhost
port=9999
threads=1
useSingleSession=true
suiteName = scripts/RegressionTest.suite
base = http://XXXXXX.XXXXXX.co.uk/Login.aspx
sahiHost = localhost
port = 9999
threads = 1
browserType = firefox
this.isSingleSession == true
Added shutdown hook.
http://localhost:9999/_s_/dyn/Suite_start?suite=scripts/RegressionTest.suite&b
ase=http%3A%2F%2FXXXXXX.XXXXXX.co.uk%2FLogin.aspx&threads=1&sahisid=sahi_49
1771bf0ee190479d0bb860ef63a2031a95&browserType=firefox&useSingleSession=true&htm
l=
FAILURE
Shutting down ...
C:\Users\Swetha\sahi\userdata\bin>
BTW Sahi and its team rightly deserves all the appreciation and in fact I have been recommending it to a few of my clients here within the UK.
Thanks for your time again.Any help will be greatly appreciated.
Thanks and regards,
Swetha
C:\Users\Swetha\sahi\userdata\bin>SET SAHI_HOME=..\..
C:\Users\Swetha\sahi\userdata\bin>SET SAHI_USERDATA_DIR=..
C:\Users\Swetha\sahi\userdata\bin>SET SAHI_EXT_CLASS_PATH=
C:\Users\Swetha\sahi\userdata\bin>CALL ..\..\bin\dashboard.bat
SAHI_HOME: ..\..
SAHI_USERDATA_DIR: ..
SAHI_EXT_CLASS_PATH:
Sahi properties file = C:\Users\Swetha\sahi\config\sahi.properties
Sahi user properties file = C:\Users\Swetha\sahi\userdata\config\userdata.proper
ties
>>>> Sahi started. Listening on port: 9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
Reading browser types from: C:\Users\Swetha\sahi\userdata\config\browser_types.x
ml
Firefox 4 was not found at C:\Program Files (x86)\Mozilla Firefox 4.0 Beta 7\fir
efox.exe
Opera was not found at C:\Program Files (x86)\Opera\opera.exe
Oct 08, 2013 12:39:33 PM net.sf.sahi.ssl.SSLHelper getKeyManagerFactoryForRemote
Fetch
INFO: No SSL Client Cert specified
>>>>>> Tests size = 2
Oct 08, 2013 12:39:33 PM net.sf.sahi.test.ProcessHelper execute
INFO: "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -profile "C:/Users/Sw
etha/sahi/userdata/browser/ff/profiles/sahi0" -no-remote -private "http://sahi.e
xample.com/_s_/dyn/Player_auto?startUrl=http%3A%2F%2FXXXXXXX.XXXXXXXX.co.uk%2F
Login.aspx__SahiAmpersandSahi__sahisid=sahi_7fc921380f8dc0480c096c50afef2cc8be7d
sahix7ea989ba06a54045f20b24e0566f8ac69703x__SahiAmpersandSahi__isSingleSession=t
rue"
#### Running Script: C:\Users\Swetha\sahi\userdata\scripts\Login.sah
Oct 08, 2013 12:39:34 PM net.sf.sahi.test.ProcessHelper$PIDGatherer run
INFO: PIDs: [1660]; 787 ms
Killing C:\Users\Swetha\sahi\userdata\scripts\Login.sah
#### Running Script: C:\Users\Swetha\sahi\userdata\scripts\Step
Killing C:\Users\Swetha\sahi\userdata\scripts\Step
Oct 08, 2013 12:39:39 PM net.sf.sahi.test.ProcessHelper kill
INFO: Kill: [1660]
Thanks in advance.
Regards,
Swetha
Here what I am guessing is that you must be using https site.
Can you please install the SSL certificate for the page once and run the script?
Also, are you able to run the single script using the controller?
Hope this helps.
Regards,
Pratik Shah
Many thanks for your response.Sadly its not a https site:(..I am able to run the single script using the controller without any issues...the issue is only when I try running the scripts in a batch...
Thanks again for coming back and hope to hear some positive news soon.
Regards,
Swetha