Script Assertion for JSON Response

URI: https://reqres.in/api/users/2

Script:

import groovy.json.JsonSlurper

def jsonresponse=messageExchange.response.responseContent
def parsejson=new JsonSlurper().parseText(jsonresponse)
def act_first_name=parsejson.data.first_name
def act_last_name=parsejson.data.last_name
def exp_first_name=context.getTestCase().getPropertyValue("firstname")
def exp_last_name=context.getTestCase().getPropertyValue("lastname")
assert act_first_name==exp_first_name
assert act_last_name==exp_last_name

#########################################
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
#Assertions
#ScriptAssertion
#JSONresponse
#APITestingTutorial
#WebServiceTesting
#AutomationTesting
#TestingScripts
#QAEngineering
#APIAutomation
#SoapUITips
#WebServicesTesting
#JSONAssertions
#APIQuality
#TestAutomation
#SoapUIPro
#APIBestPractices
#TestScripting
#JSONValidation
#APIValidation
#SoapUIAssertions
#WebServiceAutomation
#APIChallenges
#AutomationTips
#QualityAssurance
#SoapUITutorials
#WebServiceAutomation
#JSONTesting
#APIValidation
#TestingTechniques
#SoapUICommunity