Forum Discussion

aly's avatar
New Contributor
9 years ago

Is it possible to connect to mongodb from soapUI opensource using овис component?


I am now trying to connect to mongoDB from SoapUI opensource.
I have seen some topics here but have not seen if it is possible to resolve this problem with JDBC component in SOAPUI?

What I am doing is:

I downloaded mongoDB drivers from here
and here
and have put them to soapui/bin/ext folder

Then I use jdbc component to connect. I type there the following: 




but I always get the following issue, even if I try other format of connection string. Has anyone resolved this issue?
Would be very grateful for your help!

7 Replies

  • rupert_anderson's avatar
    Valued Contributor

    Hi aly,


    I never thought of using the JDBC TestStep to talk to MongoDB, quite interesting! I normally use the GMongo wrapper or MongoDB REST API instead, the GMongo Groovy TestStep option works great.


    But, if I was to try I think the driver class and connection string may be different if you try a raw JDBC connection e.g.


    JDBC Driver class name:  mongodb.jdbc.MongoDriver
    URL format:              jdbc:mongo://<serverName>/<databaseName>

    Taken from


    Also I don't think adding the GMongo driver is necessary for the JDBC test step, as the GMongo is just a nice Groovy wrapper that the JDBC TestStep cant use - think it might just need the JDBC driver details. 


    Does that help?


    Otherwise, using the GMongo Groovy TestStep Option is suprisingly nice e.g. something like (needs both the drivers you added)


     import com.gmongo.GMongo
    def mongo = new GMongo('localhost:27017')
    def db = mongo.getDB('test') db.invoices.findOne()

    I have also seen other use the Mongo REST API as a service / Request TestStep option -


    Hope this helps,




    • TesterNo1's avatar

      i tried  and could not get it working from JDBC test step.In jDBC step, you can write groovy code to access the db.It requires gmongo jar file and mongo diver  to be copied to ext folder .

      • rupert_anderson's avatar
        Valued Contributor



        Ok, I got this update from you on the ticket:



        Check teh screencast.It worked for me.


        Which looked cool, nice screencast to share the solution :-)


        But then you edited the post with whats currently written there - so are you ok with this now? or are there still problems I can try to help with?