Forum Discussion

Rasilio's avatar
Rasilio
New Contributor
13 years ago

Multiple environment tests with JDBC and HTML steps

Ok I have a SOAPUI test that it can be run against multiple different environments, the problem is the test includes both HTML steps and JDBC steps along with SOAP steps. Obviously the JDBC connection and HTTP URL need to change in response to the environment selected for the test.

Is there some way that I can detect at runtime which environment was selected and then set which JDBC connection to use on the JDBC tests?

I'm thinking the easiest way to do this would be in a groovy step that reads a property to determine the environment then sets properties for the URL and JDBC connection.

The question I have is are there properties which exist that a groovy script could interact with than can do this?

1 Reply

  • nmrao's avatar
    nmrao
    Community Hero
    Instead of using direct values in the requests, have properties.
    Properties can be at different levels i.e, at Project/TestSuite/TestCase levels. Based on the usage, variables can be used in the requests like ${#Project#PropertyName}, ${#TestSuite#PropertyName}, ${#TestCase#PropertyName}.
    Here PropertyName can be any literal and these are replaced automatically.
    Rest, it needs to taken care how the values are set to these Properties.

    There can be mutiple ways how these are set. For instance,
    1. A property file can be used and directly imported in soapui.
    2. Write groovy script

    Hope this will help.