Forum Discussion

pjw's avatar
pjw
Occasional Contributor
9 years ago
Solved

How do I set the endpoint as an Environment Variable in an HTTP Request

Hi.

 

I can set the Environement and add an Endpoint which gets picked up by a REST request.

 

However, I can't seem to get set an Environment Variable or pick up the endpioint for a HTTP Resquest Step.
Does anyone know how to do this please?

 

I have tried adding a Custom Property called https_enpoint in the Environment editor and the replacing the Enpoint in the request with  ${[#env#]https_enpoint[#value]} but this does not seem to work.

 

Can anyone help or know how to do this please?

 

env_variable.PNG

  • pjw's avatar
    pjw
    9 years ago

    Thank you Tanya.

     

    I found another way to do it.

     

    You can create a Custom Property (e.g.https_endpoint) for each environment value and then replace the Endpoint string with

     

    ${#Project#https_endpoint}

     

    It will replace at runtime depending which environment is selected.

     

    Cheers,

    Paul

     

2 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Pjw,

     

    A similar question has already discussed. Please refer to this topic – I think it will help you clarify the issue.

     

    • pjw's avatar
      pjw
      Occasional Contributor

      Thank you Tanya.

       

      I found another way to do it.

       

      You can create a Custom Property (e.g.https_endpoint) for each environment value and then replace the Endpoint string with

       

      ${#Project#https_endpoint}

       

      It will replace at runtime depending which environment is selected.

       

      Cheers,

      Paul