Tuesday, September 27, 2016

Unified Functional Test (UFT) API Testing with Data Driven Testing

HOME


UFT - API Testing for Beginner

Requirements:

1) UFT with API license: To check whether you have license for API testing open UFT and check licensed Used, if you have "Unified Functional Test" enable under it then select that.
 
2) REST or SOAP webservices which you want to test: For this tutorial I have used SOA currency conversion web services (http://www.webservicex.net/CurrencyConvertor.asmx?wsdl).

Now, Open a new API test and click on "Import WSDL"

 
and Paste the link of webservices in the popup "address" filed.

 
You can see at left hand side the services has been successfully added 
In this Currency conversion webservice we have 2 methods. Which ever method you want to parameterize  and use, just drag and drop in to "Test Flow"
  
 Now, Click on method which you have dragged to "Test Flow", at right hand side you may see "Properties Panel" 

 
In properties, we need to provide input data, like here I am converting "AUD" to "USD"
                         

now run the test you will get the result.
 
Now to parameterize this webservice we need to have an excel with "From" and "To" values.
  

Go to bottom panel of UFT there you can see the Data tab click on that and add new data source to your excel
  In below mentioned popup mention and check all the options as it is mentioned.
  
now to parameterize your request, click on Web service of your test flow and go to Properties at right hand side then click on "Link data source" to all the fields by clicking on below highlighted in image.
 
now you can see the popup, select as mentioned below one by one.

now properties panel will look like below
           
then we need to run this for all the data so click on below numbered location

now select the data source-> data sheet
 
now run the test an you can see in uft result all the iterations of your data.