Forum Discussion

grub's avatar
grub
Occasional Contributor
16 years ago

XPath assertion with wildcards

Hello ,

In an xpath assertion , after I get the expected result via select from current  , and replace some value with wildcard , then the test fails .

This is my xpath assertion :

Declare :

//ns1:getCampaignItemOverviewResponse/getCampaignItemOverviewReturn/ciid[.='${Properties: Test Case Generated Settings#draft campaign -> campaign item 1 id}']/../extra/
item/key[.='unsubscribed']/../value/item/key[.='nr']/../value

Result: select from current :

0

That is ok , but now, I want to replace the constant value ( in this case 0 ) in expected result with a wildcard * and using 'allow wildcards' , but then it says

XPathContains assertion failed for path [declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; declare namespace ns1='urn:addemar'; declare namespace addemar='http://schemas.xmlsoap.org/wsdl/'; //ns1:getCampaignItemOverviewResponse/getCampaignItemOverviewReturn/ciid[.='${Properties: Test Case Generated Settings#draft campaign -> campaign item 1 id}']/../extra/ item/key[.='unsubscribed']/../value/item/key[.='nr']/../value] : XmlValueDisconnectedException:null

kind regards

5 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    hmm.. I can't reproduce this straight off.. do you have a more detailed error or stacktrace in the error log maybe? Can you show the exact response message you are asserting? Are you using 2.5 final?

    regards!

    /Ole
    eviware.com
  • grub's avatar
    grub
    Occasional Contributor
    Hello ,

    I am using 2.5 (build dist-101-2008-11-18, build date 2008/11/18 23:05)

    This is the raw response :

    HTTP/1.1 200 OK
    Date: Tue, 25 Nov 2008 17:16:31 GMT
    Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch13 mod_ssl/2.2.3 OpenSSL/0.9.8c
    X-Powered-By: PHP/5.2.0-8+etch13
    Content-Length: 5392
    Cache-Control: max-age=2592000
    Expires: Thu, 25 Dec 2008 17:16:31 GMT
    Content-Type: text/xml; charset=utf-8


    6unsubscribednr0perc0%editednr0perc0%formnr0perc0%forwardednr0perc0%nl_BEwstest_email_1atotalnr1perc100%queuednr0perc0%sentnr1perc100%deliverednr1perc100%undeliverednr0perc0%not_openednr1perc100%openednr0perc0%clickednr0perc0%not_clickednr0perc0%invalid_domainnr0perc0%invalid_emailnr0perc0%blacklistednr0perc0%bouncednr0perc0%600

    This is the error panel content :
    XPathContains assertion failed for path [declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/'; declare namespace ns1='urn:addemar'; declare namespace addemar='http://schemas.xmlsoap.org/wsdl/'; //ns1:getCampaignItemOverviewResponse/getCampaignItemOverviewReturn/ciid[.='${Properties: Test Case Generated Settings#draft campaign -> campaign item 1 id}']/../extra/ item/key[.='unsubscribed']/../value/item/key[.='nr']/../value] : XmlValueDisconnectedException:null

    thank you in advance
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi,

    ok.. thanks.. and what is the value of the property

    Properties: Test Case Generated Settings#draft campaign -> campaign item 1 id

    when this occurs?

    regards!

    /Ole
    eviware.com
  • grub's avatar
    grub
    Occasional Contributor
    hello ,

    the property value is
    6
    for ${Properties: Test Case Generated Settings#draft campaign -> campaign item 1 id}

    By the way , this property value is also transfered into the request soap message .

    kind regards ,
    Werner
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Werner,

    thank you.. Unfortunately I can't reproduce this with a standalone request in a testcase, would it be possible for you to attach or mail me the soapUI project containing this testcase/request/assertion so I can see if something else could be causing this?

    regards!

    /Ole
    eviware.com