cancel
Showing results for 
Search instead for 
Did you mean: 

Does soap UI support cosmos DB testing

Highlighted
Contributor

Does soap UI support cosmos DB testing

Wanted to know if if SOAP UI has support for testing COSMOS DB in Azure 

9 REPLIES 9
Highlighted
Community Hero

Re: Does soap UI support cosmos DB testing

Hey @ameesh1984,

I'm guessing yes but im not 100% certain. I use ReadyAPI! but im guessing for db connections SoapUI and SoapUI Pro would be the same.

Theres 3 basic things you need to setup a db connection

1. driver file(s)
2. Java
3. Connection URL

1. Youll need to download the appropriate JDBC driver .jar files to connect to the database and save them in appropriate soapui program files directory. (If you google "cosmosDB version 'whatever' jdbc driver files" you should find some helpful links to pick up the .jar files). It might be called something like azure-documentdb-2.1.0.jar (someone picked up this .jar file to connect to cosmosDB in ReadyAPI!)

2. Youll need to download and install the correct version of Java (get the jdk not the jre download) that supports executing the driver .jar files youve already downloaded.
NOTE:If you can get both 64bit and 32bit (x86) versions of SoapUI, youll need to download the equivalent 'bit type' (dunno what else to call it) Java version. I.e. if you have 64bit SoapUI, you need to install 64bit Java , if 32bit (x86) SoapUI, youll need 32bit Java.

3. Youll need to identify the correct connection string URL which is required by ReadyAPI! and once you know the format, youll need to add this to the JDBC section of ReadyAPI!'s Preferences. Your connection string will probably look something like the following:

jdbc:cosmosdb:Server=anhohmongo.documents.azure.com;Port=10255;Database=test;User=contoso123:0Fc3IolnL123;Password=test;

(Obviously you would need to confirm your db instances connection parameter settings)

I sometimes find setting up a brand new db connection in ReadyAPI!/SoapUI a little fiddly, so what i do is setup a new db connection in a DB interrogation tool (like TOAD or DBVisualiser, etc.) Instead to test my settings and setup. You use exactly the same settings in a DB interrogatiom tool as you use in ReadyAPI!/SoapUI so once i know ive got a connection in DBVisualiser then i just replicate those settings in ReadyAPI!/SoapUI.

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: Does soap UI support cosmos DB testing

I see azure cosmos db has its own rest calls so we can use that directly from soap ui instead of using the jdbc driver

https://docs.microsoft.com/en-us/rest/api/cosmos-db/
Highlighted
Community Hero

Re: Does soap UI support cosmos DB testing

Hey @ameesh1984,

Ah...sorry...my bad...i thought you wanted an SQL connection.

I just want to highlight that my experience of querying a db via REST (ive queried a cloud based Windows Azure SQL DB via its WebAPI) has been quite difficult on certain occasions to put the REST parms together if youre executing a complex query.

Actually, remembering back to when i was doing it about a year ago, it was actually impossible to execute certain complex SQL functions (e.g. CAST, etc.) via the REST API.....the API just didnt support that sort of thing. You can still join etc., but i dont think that i could do subqueries if memory serves.

Maybe cosmosDB is different....its a NoSQL database, right? Yeah, nope...ive got zero experience hitting a NoSQL db, so i'll shut up about it! 🙂

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: Does soap UI support cosmos DB testing

If you see this link on azure site they have a lot of get and post rest calls to cosmos azure db which shows its widely used for Nosql

https://docs.microsoft.com/en-us/rest/api/cosmos-db/

Any idea on those they seems simple queries to the db
Highlighted
Community Hero

Re: Does soap UI support cosmos DB testing

Hey @ameesh1984,

i had a quick look at a GET (SELECT query) and it appears very simple....i.e. you can do a simple SELECT with basic filters and you can do INNER JOINS (didnt see any aggregate functions) but that appears to be the limit of what the REST API supports so looks a little disappointing.

HOWEVER, I need to highlight that i dont know how data is stored in a NoSQL database. Perhaps due to how the data is stored referentially etc. more complex queries arent necessary to do what you need?

I do appreciate that if youre hitting a cloud hosted database, typically the host doesnt allow its customers direct queryable access via JDBC like you would have for an on premise instance.
I always try and put my SQL together in a single complex query rather than multiple sequential queries (cos i like stretching my mind a bit and its more efficient), but theres nothing wrong in having multiple queries instead of a single complex query. Perhaps this is the approach you should use id you need to put a complex query together?

Sorry i cant be more help!

Rich


if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: Does soap UI support cosmos DB testing

Azure Cosmos DB REST API Reference | Microsoft Docs https://docs.microsoft.com/en-us/rest/api/cosmos-db/?WT.mc_id=email 

This looks like it supports all crud operations and many more for cosmos
Highlighted
Community Hero

Re: Does soap UI support cosmos DB testing

Hey @ameesh1984

Oh yeah it does...you can SELECT, INSERT, UPDATE and DELETE straightforward enough via the relevant http methods that are supported.

All im saying is that you are limited in the level of complexity for the queries you can execute. For example. If you wanted to join two tables but the referential columns in the tables had different datatypes you wouldnt be able to CAST to convert the one column to an appropriate datatype. Im using this example because it was one of the things i tried to do when i was querying a cloud based DB via REST. Another example. I couldnt update the data in one table based on the contents of the other table in others cos when you do this in SQL you need to use a subquery to do it and this wasnt supported.

It simply depends on the complexity and functions youd need to execute im guessing. If the equivalent SQL queries are reasonably basic then the REST API does the job. If what youre testing requires complex queries it wont.

Can you describe briefly what you need to test? Are you publishing messages to a webservice that updates the cosmos database. If you were testing something like this then basic queries will probably suffice. If you are testing a system where the quality of the test data is a concern then perhaps basic queries wont suffice. This is what ive found in my experience of doing this.

Cheers

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: Does soap UI support cosmos DB testing

We are testing web services and the responses of those we will compare with the cosmos db data we fetch via rest api mentioned
Highlighted
Community Hero

Re: Does soap UI support cosmos DB testing

Hey @ameesh1984,

In that case you should be able to do what you need.

Youll just perform the methods that your webservice supports (to create, update and delete records) and then follow up with a simple GET to the db API to verify the records were created, updated and deleted appropriately. At most im guessing youll need to JOIN but that is supported so it sounds like you have all your boxes ticked.

Nice one,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors