Site icon Experience, Digital Engineering and Data & Analytics Solutions by Apexon

API Automation for Internet Banking Platform

Testing

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

Problem Statement

Solution

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

API Automation

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

Benefits

 

Exit mobile version