Forum Discussion

richie's avatar
richie
Community Hero
5 years ago
Solved

Using the Environments Override When The HOST doesn't determine the environment

Hey!   This is a little confusing - so I'm going to try and be as clear as I can - I'll add visual aids :)   Within my ReadyAPI! project I have maybe 18 REST Services with various resources, ...
  • nmrao's avatar
    nmrao
    5 years ago

    richie 

    Provide payload as below

     

    resource=${#Project#RESOURCE}
    &client_id=${#Project#CLIENT_ID}
    &client_secret=${#Project#CLIENT_SECRET}
    &grant_type=client_crendentials

    You can define property file as show below, and create a file for each enrionment.

    dev.properties

    RESOURCE=<dev-resource>
    CLIENT_ID=<dev-client-id>
    CLIENT_SECRET=<dev-client-secret>

    And import the above file at project level, refer below documentation

    https://www.soapui.org/scripting-properties/working-with-properties.html

     

    So, you can similarly, use properties for END POINTS / other varying values per environment into property file and use them in the project as mentioned in the payload content.

     

    Now all you need is single project, common test cases. No separate test suites / test cases per environment any more, just use appropriate property file, import them into project before running the tests.

    If you are running the tests command line, even properties can be directly loaded runtime without even modifying the existing values in the project.