Forum Discussion

sonia's avatar
sonia
New Contributor
8 years ago
Solved

SOAPUI ability to switch between database connections for test suite

Hi

 

A bit of background:

I have an extensive amount of SOAPUI test cases which test web services as well as database transactions. This worked fine when there were one or two different environments as i would just clone the original test suite, update the database connections and then update the endpoints to point to the new environment. A few changes here and there meant i would just re-clone the test cases which had be updated for other test suites.

However, I now have 6 different environments which require these tests to be run and as anticipated, i have been adding more test cases as well as changing original ones. This causes issues when running older test suites as they need to be re-cloned.

I was wondering whether there was a better way to organise this. Ideally i would want the one test suite and be able to switch between database connections and web service endpoints but have no idea where to start with this. Any help or guidance would be much appreciated.

I only have access to the Free version of SOAPUI

This is what the structure currently looks like:

Structure of test suites

  • This question is resolved, see here

     

    Looking for something more to resolve?

5 Replies

  • JackStoneS's avatar
    JackStoneS
    Occasional Contributor

    I've had the same issue. My solution is not perfect, but workable. For every testsuite, I've added a testcase that just does the configuration.

     

    So I have a few property steps, containing the connect strings.

    Then a few property transfers that transfer the connect strings into a project/testsuite variable. I make sure the last one is the one I want to test on currently.

     

    For the JDBC-steps the connection string is read from the project/testsuite variable.

     

    Would this work for you?

    • sonia's avatar
      sonia
      New Contributor

      Hey Jack,

       

      That seems like a reasonable solution to get around it for now. Would you be able to provide me with an example of how you've set it up so i can give it a go please?

      • JackStoneS's avatar
        JackStoneS
        Occasional Contributor

        I've attached a screenshot so you can get an idea of how my workflow looks.

        So I've got a couple of instances of Properties 'database', and Property transfer 'database'. The properties step contains the web service, database connect string and some specific values I need.

        The transfer puts these in project variables.

         

         

        In the SOAP-steps I use ${#Project#Endpoint} as endpoint. In JDBC-steps I use #Project#dbConnectString as connection string.

        Does this clarify things?

  • nmrao's avatar
    nmrao
    Champion Level 3

    This question is resolved, see here

     

    Looking for something more to resolve?

    • sonia's avatar
      sonia
      New Contributor

      Hi Rao,

       

      Yes it was resolved, but i wanted to see if there was another way to d the same thing.

      I am quite interested in knowing how to work the property transfer aspect of soapui which may be of use later :)