Topic : How to Send Request & Verify Response using Groovy Script
----------------------------------
1) Create WSDL Project
http://www.dneonline.com/calculator.asmx?wsdl
2) create custom properties at test case level and pass them as params
3) Add GroovyScript step
4) Write groovy code for sending request
5) Write groovy code for getting response
6) Insert assertion
Groovy Script:
-------------------------
import com.eviware.soapui.support.XmlHolder
import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext
//How to send Request
def xmlreq=testRunner.testCase.testSteps["Add"].getPropertyValue("Request")
def a=testRunner.testCase.getPropertyValue("a")
def b=testRunner.testCase.getPropertyValue("b")
int aval=a.toInteger()
int bval=b.toInteger()
log.info aval+bval
def samplexmlreq=new XmlHolder(xmlreq)
samplexmlreq.setNodeValue("//tem:Add/tem:intA",a)
samplexmlreq.setNodeValue("//tem:Add/tem:intB",b)
def finalXML=samplexmlreq.getXml()
def addReqTest=testRunner.testCase.testSteps["Add"]
def contextAddReqTest= new WsdlTestRunContext(addReqTest)
addReqTest.run(testRunner,contextAddReqTest)
//Verify XML Response
def addXMLResponse=testRunner.testCase.testSteps["Add"].getPropertyValue("Response")
def addXMLResponseFinal=new XmlHolder(addXMLResponse)
def responseValue=addXMLResponseFinal.getNodeValue("//*:AddResult")
//Assertion
assert responseValue.toInteger()==aval+bval
#########################################
Udemy Courses
##########################################
Playwright with TypeScript
https://www.udemy.com/course/learn-playwright-web-api-testing-with-typescript/
Playwright with JavaScript
https://www.udemy.com/course/learn-playwright-with-javascript
Generative AI for Software Testing
https://shorturl.at/Uk2eM
Manual Testing + Agile with Jira Tool
https://www.udemy.com/course/learn-manual-software-testing-with-live-project-jira-tool
Selenium with Java + Cucumber
https://www.udemy.com/course/learn-selenium-with-java-live-project
Selenium with Python & PyTest
https://www.udemy.com/course/learn-selenium-with-python-d/
Selenium with Python using Robot Framework
https://www.udemy.com/course/learn-selenium-with-python-using-robot-framework
API Testing (Postman, RestAssured & SoapUI)
https://www.udemy.com/course/learn-selenium-with-python-using-robot-framework/
Web & API Automation using Cypress with JavaScript
https://www.udemy.com/course/learn-cypress-with-typescript/
JMeter - Performance Testing
https://www.udemy.com/course/learn-jmeter-m/learn/
SDET Essentials (Full Stack QA)
https://www.udemy.com/course/learn-sdet-essentials/
Appium - Mobile Automation Testing
https://www.udemy.com/course/learn-appium-latest-1110-mobile-automation-testing/
Java Collections
https://www.udemy.com/course/learn-java-collections/
Cucumber BDD Framework
https://www.udemy.com/course/learn-cucumber-bdd-framework
Protractor with JavaScript
https://www.udemy.com/course/learn-protractorangular-testing-with-javascript/