Search code examples
vbscripthp-uft

Passing value from GUI Test to API Test


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


Solution

  • 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