UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Absent Member.. Absent Member..
Absent Member..
1274 views

UFT12.5 How to pass query parameters in REST API call

We are trying to run a test that passes query parameters to a REST API using the url similar to the example url listed in the Flights application: http://localhost:8000/HPFlights_REST/Flights?DepartureCity=Denver&ArrivalCity=London  We need to be able to have the two parameters, DepartureCity and ArrivalCity  set up so that we can drive them as parameters which can be run multiple times each time with a new data pair.  The exaple in the tutorial doesn't seem to explain how to pass the parameters

 

 

0 Likes
1 Reply
Absent Member.
Absent Member.

Hi,

 

You need to create the input parameters in the REST service method and then instruct UFT to use them in the relative URL of the method. For example, for the Flights application, you would create the service with URL: http://localhost:8000/HPFlights_REST/

Then a method named Flights with input parameters DepartureCity and ArrivalCity and relative URL: 

Flights?DepartureCity={Step.RESTInputProperties.RestMethodV2_2.DepartureCity}&ArrivalCity={Step.RESTInputProperties.RestMethodV2_2.ArrivalCity}

 

The name of the method might vary in your system, please select the <Link to data source> button in the "Relative URL" field and then the <Custom Expression> button to create the necessary relative URL.

 

Kind Regards,

Francisca

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.