Forum Discussion

SanthoshShetty's avatar
SanthoshShetty
Occasional Contributor
6 years ago

How can I parameterize the complete end point details?

Hi All,

 

We are implementing REST web services automation for our system and there is a requirement to parameterize the end point details, say the end point is

 

UAT env:

https://dwu-usystem11:9002/authorizationserver/auth?username=test&password=test

Test env:

https://dwu-usystem11:9002/authorizationserver/auth?username=test&password=test

 

In our current implementation we have created two environments(Test and UAT) and saving the end point in the resepective environment. When some thing on the end point host name, that is https://dwu-usystem11:9002 changes from 9002 to 9003, then its happening to go to each and every end point ( we have around 200+ end points) and update the node value to 9002 to 9003. 

 

To over come this problem do we have a solution of maintaining the end point host name value in a property and reading it, so that if any thing changes in it we could just update the propery or any one point place.

 

 

Really appreciate your help.

 

Thanks,

Santhosh.G

4 Replies

  • Hi SanthoshShetty,

     

    Yes, you can store your endpoint in global proberties and parameterise it, so if any change came , you only need to modify only at 1 place.

     

    Global Properties situated at:

    Preference -> Global Properties

     

    Syntax to use Global Properties value:

    ${PropertyName}

     

     

    • SanthoshShetty's avatar
      SanthoshShetty
      Occasional Contributor

      Hi Himanshu,

       

      Thanks alot for your reply. It answers my question, but in our scenario we want to pass the host name details dynamically from the command line. Can we write/ overide the property value dynamically by passing the value in command line argument.

       

      Global property created is : EndPoint and its value is - https://dwu-usystem11:9002

      Actual End point: https://dwu-usystem11:9002/authorizationserver/auth?username=test&password=test

      Rest Service created in the test case in the below format:

      ${EndPoint} /authorizationserver/auth?username=test&password=test

       

      Now if I have to run on different end point say - https://dwu-usystem22:9002, then can I pass this value from the command line argument and override the existing property value so that it runs on the end point - https://dwu-usystem22:9002

       

       

      Really appreciate and thank you.

       

      Santhosh.G