Simple Excel to Test your Web API Testing Automation and Regression

Excel macro we use the HTTP function to make call and also log the responses to the Excel.


Excel can we used for Analytic and also for the Analyzing the Statistics.


Macro Test

Sub Test()

Dim strXML, strResponse, count

Set XMLHTTP = CreateObject("MSXML2.XMLHTTP")
   

count = Application.WorksheetFunction.count(Range("A:A")) + 3

'MsgBox (count)

For i = 4 To count


If Cells(i, 4) = "" Then

myurl = Cells(1, 2) + Cells(i, 3)

Else

myurl = Cells(1, 2) + Cells(i, 3) + "?" + Cells(i, 4)

End If

'MsgBox (myurl)

XMLHTTP.Open Cells(i, 2), myurl, False
XMLHTTP.setRequestHeader "signatureSecret", Cells(1, 4)
XMLHTTP.send

Cells(i, 8) = XMLHTTP.getAllResponseHeaders()
Cells(i, 9) = XMLHTTP.getResponseHeader("signatureSecret")



Cells(i, 6) = (XMLHTTP.responseText)
Cells(i, 7) = (XMLHTTP.Status)



Next i

End Sub



You use Excel function to Compare the Expected Result



Comments

Popular posts from this blog

Apache Karaf + Pax CDI OSGI Service

Apache CXF CDI in Karaf (Using CXF and CDI 1.1 (JSR-346))

OSGI + PAX CDI + Drools + Karaf