CBS_Interactive_1
14 years agoOccasional Contributor
Environment Endpoint Property Expansion Syntax
First, a bit of context. I've created a REST test in which I'd like to swap out endpoints to run the same test against different environments. While doing so I noticed that when I assign an endpoint to 'All Requests and All TestRequests' the endpoint isn't always applied to all Test Requests as it does for a SOAP test. This has several adverse effects, one being that I'm never quite sure whether or not all of my test cases are running against the correct environment, and two, the XPath Assertions and Property Transfers often fail because the namespace is hard coded to whatever environment I created the test with.
To circumvent these issues, I've created a custom property in my Test Suite called "Endpoint" in which I manually enter the Endpoint location. Then I use the following property expansion
I tried
To circumvent these issues, I've created a custom property in my Test Suite called "Endpoint" in which I manually enter the Endpoint location. Then I use the following property expansion
${#TestSuite#Endpoint} and apply it to all of my Property Transfers and Assertions. Not as seamless as I'd like it to be but it works. However I've recently come to find out that there is an Environment property expansion option and I'd like to use that instead. What I'm trying to do is pull the endpoint from the active environment that I applied from my Test Suite but I don't know the proper syntax. I tried
${#Env#Endpoint} but that didn't work. I've attempted to follow read the documentation as well but have no experience with either Java or Groovy so I found it difficult to follow. Can anyone help?!