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.
Is data driven possible through Sahi?
Is data driven possible through Sahi?
Comments
we can perform data driven test through Sahi. Please go through the Forms (http://sourceforge.net/search/?group_id=151639&words=data+driven&type_of_search=forums&pmode=0&limit=25),there you will get help.
Till now i did not perform data driven test in my application. please gather information,hope this will usefull for feature use.
Have a look at _getDB and related functions.
While adding your database driver to the class path, you should modify sahi.bat so that it looks like this:
java -cp ../extlib/your_driver.jar;../lib/sahi.jar net.sf.sahi.Proxy
in place of
java -jar ../lib/sahi.jar
For sahi.sh use
java -cp ../extlib/your_driver.jar:../lib/sahi.jar net.sf.sahi.Proxy
I made required changes to the sahi.bat and wrote the following code.
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:sahi/Data/User.xls","","");
var $rs ="";
_set($rs, db.select(select * from Sheet1));
_setValue(_textbox("userName"), $rs);
_setValue(_password("password"), "build1");
_click(_imageSubmitButton("Login"));
_click(_imageSubmitButton("Continue"));
_click(_link("Logout"));
_click(_image("OK"));
And I still get the error :
handleSet('\$rs' + 1, db.select(select * from Sheet1;));
--Stopped Playback: FAILURE--
I am not sure what went wrong.
Will some one plz help?
The quotes are missing on that line.
handleSet('\$rs' 6, db.select("select * from Sheet1"));
Here is my modified sahi.bat:
SET EXT_CLASS_PATH=C:\sahi\lib\Excel_JDBC30.jar
#SET EXT_CLASS_PATH=%EXT_CLASS_PATH%;..\extlib\mysql-connector-java-5.0.4-bin.jar
SET SAHI_CLASS_PATH=..\lib\sahi.jar
SET MOZ_NO_REMOTE=1
java -classpath %EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.Proxy
i have copied the Excel_JDBC30.jar in the lib folder.
Here is my code:
createGroup("admin", "ChangeMe");
function createGroup($username, $password){
_setValue(_textbox("log"), $username);
_setValue(_password("pwd"), $password);
_click(_submit("Login \u00bb"));
_click(_link("Users and Groups"));
_click(_link("Groups"));
var db = _getDB("sun.jdbc.odbc.JdbcOdbcDriver","jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:sahi/scripts/Tests/cv4/data/groups.xls","","");
var $rs ="";
_set($rs, db.select("select * from Sheet1"));
_setValue(_textbox("newName"), $rs[0]["groupname"]);
_click(_submit("Add Group"));
_setValue(_textbox("description"), $rs[0]["groupdescription"]);
_click(_image(41));
_click(_submit("Save"));
_click(_link("Logout"));
}
I have taken all the required steps discussed in the forum. Can anyone point out what am i doing wrong