Forum Discussion

Sriraj's avatar
Sriraj
Contributor
7 years ago

Query parameter for a project

Hi,

 

I am quite new to READY API. My problem statement is as below , Kindly suggest the best solution 

 

My project typically involves rest based services which have body in JSON and the URL looks for most of the services something like below.

 

https://endpoint/resourcepath?Brand=ABC_<Location>

 

The project is going live for Location lets say India, so my query parameter would end up being 

 

https://endpoint/resourcepath?Brand=ABC_IND and at later point of time this might get launched to US and the parameter will end up looking https://endpoint/resourcepath?Brand=ABC_US.

 

I would want to create projects so that i should be able to select the Brand just before execution of the project for a location.

 

So if i want to run the same project for  Brand=ABC_US, how should i script my projects.

9 Replies

  • So, i assume your request looks roughly like this:

     

    You can use property expansions to set the parameters for all requests in your project:

     

    So when you need to change the parameter you only change the project property and Ready! API will update all request parameters automatically.

    • Sriraj's avatar
      Sriraj
      Contributor

      Hi,

       

      Thanks for writing . I currently have the same implementation. How ever this creates a dependency on the user to manually edit the property before executing OR maintain a new project for the new country, both the steps is which i want to avoid (Any manual edits or duplicate copies of project )

       

      What i am looking for is some sort of option to select which value to use.

       

      Say , i list out the possible regions ABC_US, ABC_IND, ABC_AUS and then enable the property just before running the script.

      • Debz's avatar
        Debz
        Contributor
        1. Double-click on the project name from the Navigator.
        2. On the right side, select Environments tab.
        3. Click the button with the + to add a new environment and define the name. Ex. ABC_US or ABC_IND
        4. Make sure the environment you added is selected. Click on Rest Services tab.
        5. You should see a row that says "Resources", place the endpoint there Ex. https://endpoint/resourcepath?Brand=ABC_IND

        By the way, in the latest webinar they had, there is a Tag function. You can add several tags to test cases so you can select which ones you can run per set(or tag). Maybe it's also possible to create environment tags so that you can just select the tag you wish to run. No more need to create separate test suites per environment.