Topic : Script Assertion for XML Response

WSDL:
http://www.dneonline.com/calculator.asmx?wsdl

Script
----------
import com.eviware.soapui.support.XmlHolder

def xmlresponse=messageExchange.response.responseContent
def parsexmlresponse =new XmlHolder(xmlresponse)

// If you do not have namespace
log.info parsexmlresponse.getNodeValue("//*:AddResponse/*:AddResult")

// If you created own namespac
parsexmlresponse.namespaces["ns"]='http://tempuri.org/'
log.info parsexmlresponse.getNodeValue("//ns:AddResponse/ns:AddResult")

//Getting exp value from Test case level
log.info context.getTestCase().getPropertyValue("expsum")

//Getting exp value from Test suite level
log.info context.getTestCase().getTestSuite().getPropertyValue("expsum")

//Validation

def actsum= parsexmlresponse.getNodeValue("//ns:AddResponse/ns:AddResult")
def expsum= context.getTestCase().getPropertyValue("expsum")

assert actsum==expsum

#########################################
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/

#SoapUI
#APItesting
#Webservices
#TestingAssertions
#ScriptAssertion
#XMLResponse
#QA
#QualityAssurance
#SoftwareTesting