18 January 2026:


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.

How to delete the entry from database after running the scripts

SrinivasSrinivas Members
edited November -1 in Sahi - Open Source
Hi

Can any one please tell me the methodto delete the database entry after running the scripts

I want to run commands in batch mode that doesnot require the data base entry which is getting stored after running the first script. For ex let us consider i have a three set of scripts namely x y and z under one suite.They have to run in sequential order.After running the first script let us say "x" some data is getting saved in db.To run the second script let us say 'y' i dont need the db data which is stored after running the first script

Can any one pl tell me the method to delete the db entry after running the first script and before running the second script

Regards,
Srinivas

Comments

  • Hi Srinivas,

    Kindly follow this url:

    http://sahi.co.in/forums/viewtopic.php?id=2356

    Regards
    Sumitra
  • Hi Sumitra,

    I have seen the script but i have not understood how to run the script.

    Can u please tell me the steps to run the script

    Regards,
    Srinivas
  • Hi Srinivas,

    You can delete the database entry using _getDB().

    For more details :

    http://sahi.co.in/w/_getDB // This explains how to connect to your database and how to delete the entries in the database.

    Let me know if you face any problem.

    Regards
    Sumitra
  • Hi Sumitra,

    I have seen the details and we added jars to sahi's lib and provided the path but we not understood how to run the GetDB command.Shall we need to run the commands as usual we do by using sahi controller or we have to use command for running the commands.

    Please advise

    Regards,
    Srinivas
  • Hi Srinivas,

    Once you have added the jar's to Sahi's classpath, you can connect to _getDB using:

    var db = _getDB("oracle.jdbc.driver.OracleDriver",
    "jdbc:oracle:thin:@dbserver:1521:sid",
    "username", "password");

    For more Details: http://sahi.co.in/w/_getDB

    To run this command, include this in a .sah file and run it as a Sahi script from the controller.

    Let me know if you face any problem.

    Regards
    Sumitra
  • Hi sumitra,

    exception: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)

    After running getting this expcetion

    Please help to resolve this

    Regards,
    Srinivas
Sign In or Register to comment.