Hi Team,
How to connect Microsoft Sync SQL database to the Postman since I need to verify dynamic values from database everytime.
So I will try below steps.
Will use sql queries to retrieve data from database.
Will put those values in a variable.
Will verify those values with respect to the response.
End Goal/Requirement:
Verify the response of API through Database instead of manually retrieving the data from database and put into .csv file.
So can we connect Postman directly through database so no need to put data into .csv file. We will fetch data from database queries and will put in to variable and same variable we can put in assertion script to verify response.
Here is the database version and details, Any suggestion who we can remove those manual intervention:
As @allenheltondev noted, Postman uses web based HTTP API requests, meaning in Postman can interact with web based services. Database services are not the same as web based services, and therefore Postman cannot interact with a database directly. Even more specifically, Postman does not support ODBC / JDBC connections, which is used to connect to databases.
So, your best bet to test the database, and its data, is to create a web service (Web API), that supports connecting to the database and creating / reading / updating / deleting information in the database. Then you can use that API to test against the data in the database. While this is not explicit database testing, it may support what you desire.
You’re welcome! Sure you can make enhancement requests, you would do this in the RFC section of the community, if I’m not mistaken.
Personally, I do not believe Postman would integrate a feature such as this in the future, as their primary focus is around API and web based technologies. Though you are certainly free to make such a request.
It may be best to consider other tooling that you can do database tests with.
Hi @allenheltondev@odanylewycz@jetison
I was going through the database document Databases where I can see author trying to connect MySQL with Postman.
Is that something you mentioned above they created the URL(web service) of your database then connecting?
I am not sure what your are asking for, as this documentation would be be your reference for a developer team to create a quick webservice over a database. Granted, as noted in that documentation, this is not meant for production by any means, but rather a quick way to access the database via a webservice.
If you install the npm package, and run the command, you will have a webservice/url that you can use to access the data from the database, using the commands further in that documentation.
If this is not what you are looking for, please clarify more.
Yup, Thanks for the clarification. It mean we are on right track, If developer are ready with URL of the database then testing team will be on paramount :).
Is there any document where QA/Dev team can go through it and create the URL?
In terms of your document for QA/Dev team, the document you referenced earlier would be that document to go through and create the “URL”, or more so, create a web service for it. This will depend more on how you want networking to work with the webservice, if its going to be remotely accessed, or locally. If remotely, that involves work of setting up DNS services. Otherwise, you would just use the IP of the web service, so long as its exposed over the network.
I am not sure what you mean with your last question. What reference are you looking for? It seems to me you gave us references, that you would to end users. Those services most likely have API documentation on how to consume the web APIs they create over the database, that would be useful for end users, assuming they are looking to consume the web apis, do testing, etc.
Yup, I guess this is one of the best post where you got exactly what I am needing.
Yes, I just want to verify the values from database compare to the database.
Any solid reference? Digging more into but somewhere looks like not in the right track.
I think there is something fundamentally wrong with the processes you’re going through if you feel like this is the only way to make sure things are working.
The API you’re testing should already be connecting to the database and returning values. You shouldn’t need to implement that again to test it.
We have the APIs responses, Now we need to verify them. Those values are exactly the same what we are retrieving from the database.
As of now we are verifying them through the .csv file means manually. We run the query, getting the responses and copy/paste into .csv file.
So to avoid manual effort we need to connect database so that we can verify the data through getter/setter method.
So indirectly its Interconnected but not sure already created or not.
A. DreamFactory API management.
B. Apache Drill
Those are good option?
With he existing resource who we can go ahead?
Given the example you provided, your use case makes more sense now.
I personally haven’t worked with those options, but I know @vdespa has made a great video on using DreamFactory API.
Here you can make a request in your test script to pull the data you are looking for, and then to validate the data of the response of your API.
Though, given what @allenheltondev just said, that is likely to be a better approach, where you have complete test data initialization, and test data tear down. This is what you see very often in the testing industry, and I would opt for his suggestion as well, as adding more services can complicate things.
If you absolutely need to do connect to a database, for different testing purposes, then feel free to watch the video above.
If we could have GET and POST both methods then it was amazing But unfortunately we have GET method related API only.
And dev team have no bandwidth//approval/costing to create POST APIs.