Forum Discussion

ameesh1984's avatar
ameesh1984
Contributor
5 years ago

Does soap UI support cosmos DB testing

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

  • richie's avatar
    richie
    Community Hero
    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
      • richie's avatar
        richie
        Community Hero
        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