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.
Sahi and batch mode - how to run, how to specify user
Hello all,
my question is about running suite with batch files. My batch file is:
@ECHO OFF
java -cp d:\sahi\lib\ant-sahi.jar net.sf.sahi.test.TestRunner "D:\Sahi\userdata\scripts\testsuite.suite" "C:\Programme\Mozilla Firefox\firefox.exe" "http://test.com" default localhost 9999 1 firefox.exe
"-profile
\Sahi\userdata\browser\ff\profiles\sahi$threadNo -no-remote"
The question is, should I set manual proxy to localhost on the FF? Should I run start_sahi.bat file separate?
Because if I dont do that, tests cannot be run...do I miss something?
Second question is - Can I specify in the suite, the user to login with, for example:
# A test suite
TestNewGUI.sah http://test.com <user??>
The function I use to log with a user is:
function Login($mainurl, $userName, $userPwd, $language){
_setValue($fLoginName, $userName);
_setValue($fLoginPwd, $userPwd);
if ($language != "")
_setSelected(_select("p_sLocale"), $language);
_wait(1000);
_click($bLogin);
}
The problem is, if I do the test on different servers with different users..how can I use 1 script and only to specify the current user?
my question is about running suite with batch files. My batch file is:
@ECHO OFF
java -cp d:\sahi\lib\ant-sahi.jar net.sf.sahi.test.TestRunner "D:\Sahi\userdata\scripts\testsuite.suite" "C:\Programme\Mozilla Firefox\firefox.exe" "http://test.com" default localhost 9999 1 firefox.exe
"-profile
The question is, should I set manual proxy to localhost on the FF? Should I run start_sahi.bat file separate?
Because if I dont do that, tests cannot be run...do I miss something?
Second question is - Can I specify in the suite, the user to login with, for example:
# A test suite
TestNewGUI.sah http://test.com <user??>
The function I use to log with a user is:
function Login($mainurl, $userName, $userPwd, $language){
_setValue($fLoginName, $userName);
_setValue($fLoginPwd, $userPwd);
if ($language != "")
_setSelected(_select("p_sLocale"), $language);
_wait(1000);
_click($bLogin);
}
The problem is, if I do the test on different servers with different users..how can I use 1 script and only to specify the current user?
Comments
if (server1){
$logindata = _readCSVFile($savepath1);
} else if (server2) {
$logindata = _readCSVFile($savepath2);
}
$username = $logindata[0][0];
$password = $logindata[0][1];