How to Call Reusable API Script From GUI Script in UFT

March 21, 2018

In my previous post -How To Configure SharePoint's Services In UFT ? 
I have shown to to configure a web service in UFT. In this post we are going to see how to call them from other script.

Go to File-->New-->Test-->GUI Test-->Provide Name of the GUI test-->Provide location of the Test-->Click on Create button -->Double click on Action

Right Click on the Action-->Select Action-->Choose the last option (as per UFT 12.2) as Call to Existing API Test/Action

In the new window click on the browse button to get the API test-->Call to -->Select <Entire Test >
In the parameter List, we can see it is asking for the parameters required for the API Test. In this case it is asking for ListName and FileName (These are the parameters we created during Start)

Provide some value to each of the parameters
like- listName=ListName
Click on ok

In GUI Action we can get the entry-

RunAPITest "MyAPI","ListName","FileName"
Now we can give actual listName and FileName and execute.

for ListName you can follow my other blogpost-How to Get List Name of a SharePoint link in UFT

You Might Also Like