DB Connect is used to create a connection with the database in order to modify or retrieve data from the mentioned database.
How to navigate to DB Connect ?
Click on Configure on the left panel.
Click on DB Connect.
DB Connection String format : Type | Name / IP Address : Port | SID | Database Name | User Name | Password
...
Oracle
MySQL
SQL Server
Postgres
Pre-requisite :
If you are using localhost, make sure the server is running on your machine.
For example, the DB Connect variable created is :
Variable Name | Type | Name/IP Address:Port | SID | Database Name | User Name | Password |
---|---|---|---|---|---|---|
bqdbString | MySQL | localhost:xxxx | testDB | username | xxxxxxxx |
Now, suppose we wish to use this DB connect to retrieve data.
In the test case, use the keyword “executeQueryAndStoreResult“ and click on Data button for this keyword. You will see the below parameters :
Data Base String : Select the data type as Global Variable and select the connection string (in this case bqdbString)
Query : Enter the query you wish to make
In Variable : Enter a variable name to store the retrieved data
Click on Update button and execute the test.
The retrieved data will be store in the mentioned variable and this variable can be used further in the test.