Forum Discussion

dchester11's avatar
dchester11
Occasional Contributor
14 years ago

soapui 3.6 beta 2 XmlHolder bug??

Hi.

I have an XmlHolder object that does not seem to be executing my XPath correctly.

Calling
returnHolder.getPrettyXml()
yields
<result>
<length>1</length>
<event intEvtFrnAccId="19" dteEvtDateCreated="2010-08-20 02:41:48" bitEvtIsActive="1" dteEvtDateModified="2010-08-20 13:46:00.546" evtEncodedId="0x70120001">
<txtEvtStatus readonly="true"/>
<dteEvtDateClosed readonly="true"/>
<txtEvtLocation readonly="true"/>
<intEvtNumberComplete readonly="true"/>
<intEvtNumberIncomplete readonly="true"/>
<intEvtNumberRegistered readonly="true"/>
<bitEvtIsTest>0</bitEvtIsTest>
<dteEvtEndDate>2010-08-28 14:41:46</dteEvtEndDate>
<dteEvtStartDate>2010-08-21 14:41:46</dteEvtStartDate>
<dteEvtTrvArrDate/>
<dteEvtTrvDepDate/>
<intEvtFrnTimeZoneId/>
<txtEvtAnsField01/>
<txtEvtAnsField02/>
<txtEvtAnsField03/>
<txtEvtAnsField04/>
<txtEvtAnsField05/>
<txtEvtCode>APITest100820144139698</txtEvtCode>
<txtEvtExternalFrnKey/>
<txtEvtGoogleAnalyticsToken/>
<txtEvtName>api test event 100820144139698</txtEvtName>
<txtEvtNotes/>
</event>
</result>


But calling
returnHolder.getNodeValue("//event");
yields null. I have tested the script in standard Groovy and it evaluates correctly. Am I missing something here?

4 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    hmm.. what value are you getting? It should be just an empty string (since the event node only has whitespace content)

    regards,

    /Ole
    eviware.com
  • dchester11's avatar
    dchester11
    Occasional Contributor
    Thanks for the quick reply! It is returning null.

    log.info returnHolder.getNodeValue("//length") seems to work as expected though and returns 1
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi

    The null response is ok; probably there are no whitespaces in the actual XML (the output shown is pretty printed). What value are you actually expecting to get?

    Regards,
    Dragica
    /eviware.com
  • dchester11's avatar
    dchester11
    Occasional Contributor
    You're right. I was looking up the wrong value for what I wanted. My mistake