Passing value from GUI Test to API Test

1.4k views Asked by At

I am trying to pass a value from GUI solution to API solution in UFT (I am a bit new to UFT) The flow is like

Start 

 GUI Test

 API Test

End

What I'v tried:

TestArgs(base64)=base64Encoded   

and

Parameter(base64)=base64Encoded

base64 is the outparam I created from the properties pane of 'End' of GUI test.

Here base64 is giving me null after I assign using either of the above way

Is there any specific way to assign the value? Is this the correct way to pass a value from GUI solution to the API solution

2

There are 2 answers

0
rahul raj On BEST ANSWER

Found the soultion:

1 . Define a Inparam in the API test in the Start section. 2. while calling the API from GUI ,pass the variable from GUI test like

RunAPITest "Demoservice" ,variable

3.Assign the Inparam to the proper tag in the service in API test. Now the value in variable will go to Inparam and eventually to the assigned tag in the service call

2
dmcgill50 On

The main thing that you want to remember is that you will be creating a GUI test that will call an API test. You are able to save output parameters from the GUI test and then call your API test. You can use the article below to pass the parameters stored in the GUI test as an input parameter.

Start GUI test

 Save GUI Parameter(s)

 Call API test with "parameter(s) from Datatable" defined in the input parameters of the API test

End GUI test

Please use this article to get a feel for how to call API tests with parameters:

http://uft-help.saas.hpe.com/en/12.53/UFT_Help/Content/User_Guide/GUI_API_Integration_Use-Case_Scenario_Parameter_Passing.htm