API Automation for Internet Banking Platform

Background The program is about implementing new Internet Banking platform that aims to consolidate numerous internet instances across the Banking Group onto a shared platform and to implement new functionality for Group Businesses. The program is structured into a number of releases.

The Test Data is required for the different work streams

  •  Unit and Component Integration Test Data
  • System and System Integration Test Data
  • Automation Testing Team — Regression Test Data
  • Non Functional Test Data
  • Business Team — User Acceptance Test Data

Problem Statement

  • Numerous amount of test data request to be catered within given time frame.
  • Considerable amount of manual effort needed to create & tweak the test data using  Web applications, different desktop application, Mainframe systems
  •  Delivery slippage risk due to unavailability of the above said applications.
  • Manual data tweaking through mainframe systems was cumbersome & time consuming.

Solution

  • Investigation done to find out APIs responsible for data creation & tweaking through backend
  • Developed automation framework including combination of APIs, web applications &

Mainframe system in logical sequence, to do tweaking on the base accounts

API Automation

  • Directly can fire the APIs through Microsoft.XMLDOM and XMLHTTP objects for this we have to create a template XML file form the WSDL
  • Controller will call a specific API with the required data to be updated in existing XMLs. To update the XML for example <VBScript>

Variables details

strPath (The Directory Path)

srcCCXMLPath(Source XML File Path)

XMLNewFile(Updated XML will be saved on this Location)

destCCXMLPath(Response for the API will saved on this path)

strUpdate(A string with the Node Name and the Values with the separators i.e “;” and “=” )

LinkBUrl(API to be fired on this destination)

Response(Boolean Value for the result of API)

Sample Code

strPath=Environment.Value(“TestDir”)

Set fso = CreateObject(“Scripting.FileSystemObject”)

TestPath = fso.Getparentfoldername(strPath)

srcCCXMLPath = TestPath & “\XML_Template\” & CCXML

destCCXMLPath = TestPath & “\XML_Template\CreditCardXML_Resp.XML”

#And then we calls the reusable functions to update and sent the API on the URL

strUpdatedXML =   fnUpdateXML(srcLinkBXMLPath,strUpdate)

 

#Function body to update the XML File

‘********************************************************************’FUNCTION HEADER

********************************************************************’Name: fnUpdateXML

‘Description: This function is for updating the existing XML file with the passed parameters

‘Input Parameter:   XML file name, String in “XMLtag=XMLValue” format

‘ObjectName : XML DOM Object

‘Created By: Kuldeep Sharma ‘*****************************************

Public Function fnUpdateXML(ByVal XMLNewFile, ByVal strUpdateString)

arrSplitNode = split(strUpdateString,”;”)

For i=0 to ubound(arrSplitNode)

arrValue = split(arrSplitNode(i),”=”)

Set xmlDoc = CreateObject( “Microsoft.XMLDOM” )

xmlDoc.load(XMLNewFile)

Set objNodeList = xmlDoc.getElementsByTagName(arrValue(0))

set str = objNodeList.Item(0)

str.text = arrValue(1)

strUpdateXML = xmlDoc.text

xmlDoc.Save(XMLNewFile)

Next

Set xmlDoc = nothing

fnUpdateXML = strUpdateXML

End Function

 

# We can send this request to the URL with the XMLHTTP Objects

Response = SendXML(srcLinkBXMLPath,destLinkBXMLPath,LinkBUrl)

‘********************************************************************************* ‘FUNCTION HEADER

‘*********************************************************************************

‘Name: SendXML

‘Description: This function is to send the XML to the specified server

‘Input Parameter:   source XML file name, Destination XML file name, Server URL

‘ObjectName : XML DOM Object, XML HTTP Object

‘Created By: Kuldeep Sharma ‘*********************************************************************

Set xmlhttp = CreateObject(“Microsoft.XMLHTTP”)

xmlhttp.open “POST” ,url, False

Set xmldom = CreateObject(“Microsoft.XMLDOM”)

xmldom.load(srcXMLFile)

xmlhttp.send xmldom

xmlhttp.ResponseXML.Save(destXMLFile)

resp = FetchXML(destXMLFile, “SeverityCode”)

If resp = “0” Then

SendXML = True

Else

SendXML = False

End If

Set xmlhttp = nothing

Set xmldom =nothing

End Function

”*******************************************************************

Function FetchXML is to ready the API Response if it is Passed

”*********************************************************************’FUNCTION HEADER ‘**********************************************************************

‘Name: FetchXML

‘Description: This function is for fetching XML tag value

‘Input Parameter:   XML file name, XML tag name

‘ObjectName : XML DOM Object

‘********************************************************

Public Function FetchXML(ByVal XMLNewFile, ByVal XMLTag)

On Error Resume next

Set xmlDoc1 = CreateObject( “Microsoft.XMLDOM” )

xmlDoc1.load(XMLNewFile)

Set objNodeList = xmlDoc1.getElementsByTagName(XMLTag)

set str = objNodeList.Item(0)

XMLTagValue = str.text

FetchXML = XMLTagValue

Set xmlDoc1 =nothing

End Function

‘****************************************************************************

Features & Benefits

Features

  • Factory Model Framework
  • Unique Solution of its Kind
  • Error Handling on code and functional level
  • Plug and Play framework (Completely Modular)
  • User Friendly

Benefits

  • High Effort Saving.
  • Less Manual intervention ensures less probability of error
  • Less dependency on UI
  • 50 % of effort saving.

 

Interested in our Testing Services?

+1 408-727-1100

By submitting this form, you agree that you have read and understand Infostretch’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

By submitting this form, you agree that you have read and understand Infostretch’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

Other stories you may enjoy...

What You Need to Know about Automated Visual Testing

Recent surveys suggest that nearly a quarter of all apps are abandoned after just one use. Ouch! Not only is this unsettling for developers, but it’s also not a sustainable way...

Test Automation for Multilanguage Mobile App using QTP – Perfecto Solution

Localization Testing “Localization is the process of customizing a software application that was originally designed for a domestic market so that it can be released in...