|
This topic explains the steps to configure the various databases in QEngine. QEngine supports any JDBC compliant database. But, you need to set the appropriate classpath for the database driver by editing the DB_CLASSPATH variable in setcommonenv.bat/.sh file in <QEngine_Home>/bin directory. Also, you need to add the new database in the Database Configuration screen using the Insert Testcase UI or Data Configuration UI.
You can configure one of the below databases or any JDBC compliant database to add database checkpoints or fetch values from database for data-driven testing wherein you can run the same script with multiple set of data.
The steps to configure some of the popular databases such as MS SQL
Server and Oracle using QEngine is given below. For any other JDBC compliant
database, as said above you need to place the appropriate jars in <QEngine_Home>/jars
directory and set the appropriate classpath for the database driver by
editing the DB_CLASSPATH variable in setcommonenv.bat/.sh
file in <QEngine_Home>/bin
directory and follow the steps below.
MS SQL Server
Set the classpath to the SQL Server jars such as mssqlserver.jar, msbase.jar and msutil.jar in setcommonenv.bat/.sh file in <QEngine_Home>/bin directory by editing the DB_CLASSPATH variable as follows:
set DB_CLASSPATH = %SERVER_HOME%\jars\mssqlserver.jar;%SERVER_HOME%\jars\msbase.jar;
%SERVER_HOME%\jars\msutil.jar
Invoke the Database Configuration screen from the Insert Testcase screen or from the Data Configuration screen based on whether you are inserting a test case or fetching values from a database for data-driven testing. To know the steps of how to add a test case or data configuration, refer to the topics Adding Testcase or Creating Data-driven test scripts.
In the Database Configuration screen, click the "New Database" button placed below the list in the left pane to add the new database SQL Server.
Enter the "DB Name" as SQLServer, "Driver Name" as com.microsoft.jdbc.sqlserver.SQLServerDriver.
Enter the "Connection URL" as jdbc:microsoft:sqlserver://"<host_name>":"<port_name>";DatabaseName="<database_name>", username and password. In this URL, host name is the machine where you installed MS SQL Server. Click the "Commit To List" and "Apply" button to add the new database.
Now, execute the script to test with the new database.
Oracle
Set the classpath to the Oracle classes12.zip in setcommonenv.bat/.sh file in <QEngine_Home>/bin directory by editing the DB_CLASSPATH variable as follows:
set DB_CLASSPATH = <PATH>/classes12.zip
<PATH> is the location where classes12.zip
is located.
Invoke the Database Configuration screen from the Insert Testcase screen or from the Data Configuration screen based on whether you are inserting a test case or fetching values from a database for data-driven testing. To know the steps of how to add a test case or data configuration, refer to the topics Adding Testcase or Creating Data-driven test scripts.
In the Database Configuration screen, click the "New Database" button placed below the list in the left pane to add the new database SQL Server.
Enter the "DB Name" as Oracle, "Driver Name" as oracle.jdbc.driver.OracleDriver.
Enter the "Connection URL" as jdbc:oracle:thin:@<host_name>:<port_number>:<SID>, username and password. In this URL, host name is the machine where you installed Oracle. Click the "Commit To List" and "Apply" button to add the new database.
Now, execute the script to test with the new database.
|