Run SQL queries to generate test data and use in Apigee Test

Not applicable

We are currently exploring Apigee Test. We have this Test automation structure where we want to integrate the ability:

- Run SQL Queries to grab test data from the database

- Run API tests based on the retrieved data

- Run SQL Queries to confirm data sanity at the database level

Is there a way to run sql queries or sql scripts from Apigee Test?

0 4 560
4 REPLIES 4

@TariqGhalib ,

I am afraid, Apigee Test doesn't support SQL scripts out of the box. But, As you know, You can create / chain test cases to make an use case in Apigee Test.

  • You can create APIs in Apigee Edge that interact with your datastore / run sql queries, grab test data, output same as API Response.
  • Use Above API Response as input to the API Tests in Apigee Test
  • Make one more API call in test case which will run SQL queries to confirm data sanity at database level.

Basically, Instead of SQL script, just build an API that does SQL Queries & use APIs in Apigee Test

Thanks Anil!

What I understood is that:

We create a proxy and then may be add a policy that enables us to run SQL queries --> and then grab the data from the API call response as input to test Apigee --> and then make further API call to the first proxy and confirm data sanity.

By any chance, could you please elaborate this a bit further. An example would be perfect and would help a lot.

@TariqGhalib , It might be easy to build API at target side than proxy side that run sql queries. You can do on proxy side too by leveraging Apigee Node Capabilities where Node.JS app talks to your backend db & expose the functionality as an API. For example see volos connector for mysql that allows CRUD operations on DB as APIs

Can you please explain a bit more about the solution to build API at target side? Do mean write the SQL to REST mapping at the target side and then retrieve data from target using rest calls??

Do you guys have support for MS SQL? Its still showing "coming soon" for the MS SQL Connector. We will need that to start implementing the proxy side solutions.