Asserting NULL values
I'm doing comparison of values in Oracle database on one end and the service at the other. There are attributes which return NULL value and those same attributes are not found in the service response when this is the case. I need an assertion in the REST request that will pass this scenario, but the regular assertions do not work. When I try to assert these, I get the following error: Comparison failed. Path: [$['list'][0]['firstLevelNode'][0]['attributeName']]; Expected value: []; Actual value: []. Expected value is the attribute from the JDBC Request and the Actual value is the corresponding attribute from the REST request. As you can see, the responses are the same, but the assertion does not pass. Is there a way to bypass this? Thanks. EDIT: I know this can be done with a Groovy script, but I would really prefer a solution with assertions inside the REST request.1.8KViews0likes5CommentsUsing multiple * wildcard in an xpath assertion throws NPE
Hi, I'm currently creating an assertion for an xpath result that contain multiple dates. And so I have: <created>*</created> <updated>*</updated> <updater>opencell.admin</updater> Which fails, but: <created>*</created> <updated>2018-04-17T09:14:18.190+08:00</updated> <updater>opencell.admin</updater> Succeed. Error I got was: XPathContains assertion failed for path [//return[1]/xxx/yyy[@code="zzz"]] : NullPointerException:null Seems like multiple instance of * wildcard doesn't work? Is there a workaround?693Views0likes0CommentsAssertions with XPATH
Sorry if this is in wrong area, but I am new to SOAP UI os. I am currently trying to achieve a simple test case where if I call a service with no parameters, the response should not provide me any information back. Super simple. With that, I am trying to get an understanding of xpath assertions. I used xpath in selenium tests. But I do not understand what I am doing wrong on the Xpath match configuration screen. I see that when IclickDeclare, it provides me namespaces in XPath Expression box. It provides this: declare namespace soap='http://www.w3.org/2003/05/soap-envelope'; declare namespace ns1='https://ForceDevelopmentServices.ServiceCode.DCPDS.EducationData.DataContracts'; declare namespace ns2='http://schemas.microsoft.com/2003/10/Serialization/'; declare namespace ns3='http://tempuri.org/'; declare namespace ns4='https://USAF.A1.Personnel.ForceDevelopment.DAL.Services.Base'; Under Assertions, I used a online xpath tester http://www.freeformatter.com/xpath-tester.html#ad-output to get this xpath expression: //for1:SSAN/text() I would expect to place a ? in the expected results box, but when I click on Select from current I get an error message saying "Missing content to select from". I then tried to click on the 'Test' to see what happens, I get another error message saying "Missing Content" I looked over Query/Match, I did not get much from this view since it does not seem to do anything when I put in xpath query or Matching Value Any assistance would be greatly appreciated. Thanks in advance. alex <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:for="https://ForceDevelopmentServices.ServiceCode.DCPDS.EducationData.Interfaces" xmlns:for1="https://ForceDevelopmentServices.ServiceCode.DCPDS.EducationData.DataContracts"> <soap:Header/> <soap:Body> <for:GetAcquisitionsCertificationsBySSANResponse> <!--Optional:--> <for:GetAcquisitionsCertificationsBySSANResult> <!--Zero or more repetitions:--> <for1:DCPDSAcquisitionsCertification> <!--Optional:--> <for1:SSAN>?</for1:SSAN> <!--Optional:--> <for1:ACQ_DT_CAREER_LVL_ACHVD>?</for1:ACQ_DT_CAREER_LVL_ACHVD> <!--Optional:--> <for1:ACQ_CAREER_LEVEL_ACHVD_DESC>?</for1:ACQ_CAREER_LEVEL_ACHVD_DESC> <!--Optional:--> <for1:ACQ_CAREER_LVL_APPR_AUTH>?</for1:ACQ_CAREER_LVL_APPR_AUTH> <!--Optional:--> <for1:ACQ_CAREER_LVL_APPR_AUTH_DESC>?</for1:ACQ_CAREER_LVL_APPR_AUTH_DESC> <!--Optional:--> <for1:ACQ_CERT_CAREER_FIELD>?</for1:ACQ_CERT_CAREER_FIELD> <!--Optional:--> <for1:ACQ_CERT_CAREER_FIELD_DESC>?</for1:ACQ_CERT_CAREER_FIELD_DESC> </for1:DCPDSAcquisitionsCertification> </for:GetAcquisitionsCertificationsBySSANResult> </for:GetAcquisitionsCertificationsBySSANResponse> </soap:Body> </soap:Envelope>3.8KViews0likes4CommentsUnable to add assertion
Hi, with a very simple project, I am trying to add assertions to my SOAP requests. When I clicked on the + icon, the dialog opens, but all is shown is Contains. All the others types are missing. Also, I cannot select any option on the left. Working with SoapUI 5.2.1 on Win 7 64. Logs files attached. Anyone can help me on this? Thanks4.8KViews0likes19CommentsHow to apply common assertions at Project or Suite Level
Hi, I have a test suite in soapUi which has many test cases . And each test cases contains multiple REST requests tests steps as well. I would like to add assertions for all of those requests test steps , but I don’t want to add common types of assertions at each and every request level. Say for example I want to add assertions for http response status code . This assertion is going to be a common one and it should be checked for all the requests . Adding this common assertion for each and every test step is going to be a manual effort , and looking for a better approach. Instead of adding this at every request level, is it possible to add at test suite / test case level or some other way, so when the execution of suite happens , this gets checked for all the requests. I use free version of soapUI Thanks & Warm Regards MusaffirSolved2.1KViews0likes1Commentcompare response of a failed test step to the "contains" assertion and log differences
I've been searching for a way to compare the response of a failed test step to the "contains" assertion of that test step, and spit out just the differences into a log file called that teststepname/label. Sounded so easy :( In other words, I need a groovy script that's going to sit at the end of the test case and run through all failed test steps inside that testcase then compare each line in the response to each line in the test step assertion contains(its called Contains Assertion which is literally a copy paste of a previous valid and working response) and then we need to spit out the line(s) that are different into a log/file.Solved2.9KViews0likes7CommentsAsserting using GROOVY SCRIPTING
Hi Techies, I am a SOAP UI Beginner and I am trying to validate the response XML from a simple currency converter web service : http://www.webservicex.net/CurrencyConvertor.asmx?WSDL I got the response as : ################################################################################ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <ConversionRateResponse xmlns="http://www.webserviceX.NET/"> <ConversionRateResult>63.665</ConversionRateResult> </ConversionRateResponse> </soap:Body> </soap:Envelope> ################################################################################ Now I would like to validate the response and I have written the below Groovy script. However I always get value as NULL. Can someone please help me in this regard ? ================================================== def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def holder = groovyUtils.getXmlHolder( messageExchange.responseContent ); holder.namespaces["ns"] = "http://www.webserviceX.NET/"; def responseId = holder.getNodeValue["//ns.ConversionRateResult"]; log.info responseId ================================================== The output is always NULL. I have made so many references but couldn't get the correct solution. Please help.Solved3.4KViews0likes5Comments