Article Overview:
This article describes how to achieve the following:
How to connect databases to Virtuoso to perform SQL-like queries for testing purposes.
Problem Statement:
How do you access a database that doesn’t have APIs?
Solution:
Virtuoso is a codeless test automation platform, hosted on AWS, that can test applications on private networks using its Bridge Client. For database connections, the Virtuoso Bridge uses DB connectors through API endpoints.
Supported databases:
1. Microsoft SQL Serve
2. PostgreSQL
3. MySQL
4. Azure CosmosDB
5. Oracle.
The document provides clear steps for configuring and using these connectors, ensuring smooth integration with Virtuoso for SQL-like queries.
How to configure DB Connector On your PC.
1. Download the SQLAPI Windows binary file from the below link.
Windows binary for the Virtuoso DB Connector download from here.
Linux binary for the Virtuoso DB Connector download from here.
2. Extract the all the files from the downloaded zip.
3. Depending on your database server, configure the appsettings.json file from the above extracted SQLAPI-Windows-0.3.0 folder.
4. The appsettings.json file for each supported database is shared later in this document.
5. Set up your Virtuoso Bridge client.
6. Pick/Note any one of IP that Bridge client shows when you connect.
7. Now Copy the below-mentioned appsetting.json configuration based on your DB Server.
8. Open the appSettings.json file. Paste the Copied Configuration from Step 7.
9. Now update your IP address in the Url section.
In the example below, I took the 2nd IP and replaced it with the URL’s value.
10. Update your User ID, and Password in the Connection string.
11. Save the file and close It.
12. Now run the “SQLAPI.exe” file.
13. In the command prompt, you will see similar results to the screenshot below, with your URLs configured in the appsetting.json file and the message “application started ”.
14. Now Connect your Bridge to your Virtuoso journey.
15. Import the SQLAPIDBQUERY extension into your Virtuoso project by clicking the link below.
16. Now, Go to Previous Document.
17. Go to your Journey, and add the below steps.
Note: Replace the IP with the one that you noted in step 6.
Navigate to "http://xxxxxxxxx:5001"
SQLApiDBQuery("http://xxxxxx:5001", "SELECT * FROM Employees") returning $response
18. Response will be In JSON format under the side effects tab.
Note:
For configuring appsettings.json: Please refer to this appsetting.json configuration Document.
Comments
0 comments
Article is closed for comments.