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.



Step-1:
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

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

Step-3
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)

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

Step-5
In GUI Action we can get the entry-

RunAPITest "MyAPI","ListName","FileName"
Step-6
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

0 comments