ArmandsBruns
11 years agoFrequent Contributor
Create Web Service Load test for LoadUI test
Hi,
I'm a beginner using soapUI.
I have a web service script which is created in TestComplete. How can create the same test script in soapUI and run it in LoadUI?
Script example:
'---------------------------------------------------------------------------------------------------------------------------'
Sub Main_Test
Dim Str, date, DateNow
Dim result, result2, result3
Dim createClaimsDetalization
Dim validateClaimsDetalization
date = Utilities.Date()
DateNow = Utilities.FormatDateTime("dd.mm.yyyy", date)
'-------------authentificateUser method test------------------------------
Call Log.Message("authentificateUser method test")
' Prepare paramters for the call
Set authentificateUser = authentificateUser1
' Call the authentificateUser method of the tested web service
Set result = WebServices.GDisWebService.authentificateUser(authentificateUser)
' Post the results to the log
Str = aqString.Format("return = '%s'" & vbCrLf & "daysToChangePassword = %i" & _
vbCrLf & "status = %i" & vbCrLf & "statusText = '%s'", _
result.return, result.daysToChangePassword, result.status, result.statusText)
Call Log.Message("authentificateUser web service call result: " + Str, Str)
'-------------validateClaimsDetalization method test----------------------
Call Log.Message("validateClaimsDetalization method test")
Set validateClaimsDetalization = validateClaimsDetalization1
' Prepare parameters for the call
validateClaimsDetalization.sessionKey = result.return
' Call the validateClaimsDetalization method of the tested web service
Set result2 = WebServices.GDisWebService.validateClaimsDetalization(validateClaimsDetalization)
' Post the results to the log
Str = aqString.Format("status = %i" & vbCrLf & "statusText = '%s'", _
result2.return.status, result2.return.statusText)
Call Log.Message("ValidateClaimsDetalization web service call result: " + Str, Str)
'-------------createClaimsDetalization method test----------------------
Call Log.Message("createClaimsDetalization method test")
Set createClaimsDetalization = createClaimsDetalization1
' Prepare parameters for the call
createClaimsDetalization.sessionKey = result.return
' Call the createClaimsDetalization method of the tested web service
Set result3 = WebServices.GDisWebService.createClaimsDetalization(createClaimsDetalization)
' Post the results to the log
Str = aqString.Format("status = %i" & vbCrLf & "statusText = '%s'" & _
vbCrLf & "detID = '%s'", _
result3.return.status, result3.return.statusText, result3.return.detID)
Call Log.Message("CreateClaimsDetalization web service call result: " + Str, Str)
End Sub
Dim date, DateNow
Dim PV
Set PV = Project.Variables
date = Utilities.Date()
DateNow = Utilities.FormatDateTime("dd.mm.yyyy", date)
Function authentificateUser1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set authentificateUser1 = TypeFactory.authentificateUser1
authentificateUser1.username = PV.username
authentificateUser1.password = PV.password
End Function
Function validateClaimsDetalization1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set validateClaimsDetalization1 = TypeFactory.validateClaimsDetalization1
' Prepare parameters for the call
validateClaimsDetalization1.insPersCode = PV.validateClaimsDetalization(0)
validateClaimsDetalization1.cardNumber = PV.validateClaimsDetalization(1)
validateClaimsDetalization1.serviceCode = PV.validateClaimsDetalization(2)
validateClaimsDetalization1.serviceCount = PV.validateClaimsDetalization(3)
validateClaimsDetalization1.sumToPay = PV.validateClaimsDetalization(4)
validateClaimsDetalization1.medInstCode = PV.validateClaimsDetalization(5)
validateClaimsDetalization1.eventDate = DateNow
End Function
Function createClaimsDetalization1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set createClaimsDetalization1 = TypeFactory.createClaimsDetalization1
' Prepare parameters for the call
createClaimsDetalization1.insPersCode = PV.createClaimsDetalization(0)
createClaimsDetalization1.cardNumber = PV.createClaimsDetalization(1)
createClaimsDetalization1.serviceCode = PV.createClaimsDetalization(2)
createClaimsDetalization1.serviceCount = PV.createClaimsDetalization(3)
createClaimsDetalization1.sumToPay = PV.createClaimsDetalization(4)
createClaimsDetalization1.medInstCode = PV.createClaimsDetalization(5)
createClaimsDetalization1.eventDate = DateNow
End Function
Regards
Armands
I'm a beginner using soapUI.
I have a web service script which is created in TestComplete. How can create the same test script in soapUI and run it in LoadUI?
Script example:
'---------------------------------------------------------------------------------------------------------------------------'
Sub Main_Test
Dim Str, date, DateNow
Dim result, result2, result3
Dim createClaimsDetalization
Dim validateClaimsDetalization
date = Utilities.Date()
DateNow = Utilities.FormatDateTime("dd.mm.yyyy", date)
'-------------authentificateUser method test------------------------------
Call Log.Message("authentificateUser method test")
' Prepare paramters for the call
Set authentificateUser = authentificateUser1
' Call the authentificateUser method of the tested web service
Set result = WebServices.GDisWebService.authentificateUser(authentificateUser)
' Post the results to the log
Str = aqString.Format("return = '%s'" & vbCrLf & "daysToChangePassword = %i" & _
vbCrLf & "status = %i" & vbCrLf & "statusText = '%s'", _
result.return, result.daysToChangePassword, result.status, result.statusText)
Call Log.Message("authentificateUser web service call result: " + Str, Str)
'-------------validateClaimsDetalization method test----------------------
Call Log.Message("validateClaimsDetalization method test")
Set validateClaimsDetalization = validateClaimsDetalization1
' Prepare parameters for the call
validateClaimsDetalization.sessionKey = result.return
' Call the validateClaimsDetalization method of the tested web service
Set result2 = WebServices.GDisWebService.validateClaimsDetalization(validateClaimsDetalization)
' Post the results to the log
Str = aqString.Format("status = %i" & vbCrLf & "statusText = '%s'", _
result2.return.status, result2.return.statusText)
Call Log.Message("ValidateClaimsDetalization web service call result: " + Str, Str)
'-------------createClaimsDetalization method test----------------------
Call Log.Message("createClaimsDetalization method test")
Set createClaimsDetalization = createClaimsDetalization1
' Prepare parameters for the call
createClaimsDetalization.sessionKey = result.return
' Call the createClaimsDetalization method of the tested web service
Set result3 = WebServices.GDisWebService.createClaimsDetalization(createClaimsDetalization)
' Post the results to the log
Str = aqString.Format("status = %i" & vbCrLf & "statusText = '%s'" & _
vbCrLf & "detID = '%s'", _
result3.return.status, result3.return.statusText, result3.return.detID)
Call Log.Message("CreateClaimsDetalization web service call result: " + Str, Str)
End Sub
Dim date, DateNow
Dim PV
Set PV = Project.Variables
date = Utilities.Date()
DateNow = Utilities.FormatDateTime("dd.mm.yyyy", date)
Function authentificateUser1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set authentificateUser1 = TypeFactory.authentificateUser1
authentificateUser1.username = PV.username
authentificateUser1.password = PV.password
End Function
Function validateClaimsDetalization1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set validateClaimsDetalization1 = TypeFactory.validateClaimsDetalization1
' Prepare parameters for the call
validateClaimsDetalization1.insPersCode = PV.validateClaimsDetalization(0)
validateClaimsDetalization1.cardNumber = PV.validateClaimsDetalization(1)
validateClaimsDetalization1.serviceCode = PV.validateClaimsDetalization(2)
validateClaimsDetalization1.serviceCount = PV.validateClaimsDetalization(3)
validateClaimsDetalization1.sumToPay = PV.validateClaimsDetalization(4)
validateClaimsDetalization1.medInstCode = PV.validateClaimsDetalization(5)
validateClaimsDetalization1.eventDate = DateNow
End Function
Function createClaimsDetalization1
Dim TypeFactory
'Get the type factory for the web service
Set TypeFactory = WebServices.GDisWebService.TypeFactory
Set createClaimsDetalization1 = TypeFactory.createClaimsDetalization1
' Prepare parameters for the call
createClaimsDetalization1.insPersCode = PV.createClaimsDetalization(0)
createClaimsDetalization1.cardNumber = PV.createClaimsDetalization(1)
createClaimsDetalization1.serviceCode = PV.createClaimsDetalization(2)
createClaimsDetalization1.serviceCount = PV.createClaimsDetalization(3)
createClaimsDetalization1.sumToPay = PV.createClaimsDetalization(4)
createClaimsDetalization1.medInstCode = PV.createClaimsDetalization(5)
createClaimsDetalization1.eventDate = DateNow
End Function
Regards
Armands