1

We have two different environments and for those environments the endpoint and the path changes, e.g.

http://env-qa.domain.com/path1/serviceName

http://env-uat.domain.com/path2/serviceName

I know how to use the Environments feature to change the Endpoint URL (e.g., http://env-qa.domain.com/) but how do I change the path (e.g. /path1/serviceName)?

I looked through the Environments help, etc. but can't find anything that tells me how to do this. The help is ... sparse and much of it is out of date.

1

Couple of options

  1. Duplicate the suite, one with one path, one with the other. This could cause you maintenance headaches though

  2. Create a variable for the property (template) and have a conditional go to in a test script

    • Groovy Script (If env = UAT go to Properties (UAT))
    • Properties (Live endpoint)
    • Property Transfer to endpoint of Test Steps

    • Test steps

    • Groovy Script (Go to End Step, code at bottom)

    • Properties (UAT endpoint)
    • Property Transfer to endpoint of Test Steps
    • Groovy Script (Go to Test, code at bottom)

    • End Step

Groovy Script (Go to End Step)

testRunner.gotoStepByName("End Step")
log.info 'Gone To End Step'

Groovy Script (Go to Test Steps)

testRunner.gotoStepByName("Test steps")
log.info 'Gone to Test steps'
  • you could use a conditional go-to if you prefer but that is a pro feature so used groovy scripts as you didn't specify your version – ECiurleo Dec 11 '15 at 12:06
  • Thanks for the answer. I'm going to accept this because this is probably the best way to do this if you build this into your suite from the beginning. At this point I have hundreds of tests and I don't have the time or inclination to modify all of them. What I'm doing is just editing the path for the services when I need to switch the environment. It's not hard but it's a pain... – JeffC Dec 11 '15 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.