Model 18 Part 2 : Live project : Not getting Json Response , Assertion is Not working | SOAPUI Forum
K
Kam Posted on 22/11/2022

I have 3 issues:

1, When sending Request, Response is NOT getting in Json

=================Issue # 2 ====================

use following code for assertion:


import groovy.json.JsonSlurper

// read the response

def response=context.expand('${LoginReq#response}')
log.info "RESPONSE IS ---------->"+ response

def slurper = new JsonSlurper()
def json = slurper.parseText(response)

def actualStatus=json.loginStatus
def expectedStatus=context.expand('${StartLoop#ExpectedRes}')

log.info actualStatus +" ------ "+ expectedStatus

assert actualStatus == expectedStatus, " Got the login Status as ----> " + actualStatus

 


Mon Nov 21 22:13:28 EST 2022: INFO: RESPONSE IS ----------><!doctype html><html lang="en"><head><title>HTTP Status 404 – Not Found</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 404 – Not Found</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> The requested resource [&#47;Retail_App_Rest&#47;retail&#47;admin&#47;login] is not available</p><p><b>Description</b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/10.0.27</h3></body></html>

 

Project:

 

====================================================Question 3==============

what is creitionals to login REST Pro Soap UI 


K
Kam Replied on 22/11/2022

attaching Report