Forum Discussion

minoseah629's avatar
minoseah629
Occasional Contributor
9 years ago

Assertions 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 I click Declare, 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>