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.
close the db connection
Hi,
Is there any way to close the DB connection in sahi?
Regards,
Vazid
Is there any way to close the DB connection in sahi?
Regards,
Vazid
Comments
Example:
I will go to a web page enter a new user to something. If I have a query that looks up the new entry and one to delete it for clean up. But because sahi likes to build up and run queries lots even if there is only two it causes this problem.
I make the new user I got to check it but when sahi runs the get query it immediatly runs the clean up query deleting any chance of me performing a check and clean up within the same script.
I've created a DB function like
function DBconn()
{
var $driver="com.hxtt.sql.excel.ExcelDriver";
var $Loginfile=<path of the file>;
var db=_getDB($driver,$Loginfile, "username", "password");
var $rs =[];
$rs=db.select("select * from Sheet1");
return($rs);
}
And im trying to call this function in another scritps of mine..but when I try to set my web page for the play back sahi window [sahi cmd prompt] shows these below lines again n again even while running and i found it bit strange, even if i stop the script and just work with my application still these lines keep scrolling in sahi cmd prompt
Driver: com.hxtt.sql.excel.ExcelDriver
JDBC URL: jdbc:excel:/<path of the file>
Username: username
Password: password
SQL: select * from Sheet1
I believe this is due to not clearing of cache or some thing which im not sure....I've seen posts of similar problems..
But using this db connection thing i'm facing lot of problems in running scripts..
if i hard code values in scritps and run them then the scripts runs fine but when i apply the above said db function then the script stops in between with no error being displayed...I have to then restart sahi.bat
Has any one has any work around for this prob??? Please let me know....
Rgds.