Forum Discussion

Michael_Heinze's avatar
Michael_Heinze
Contributor
15 years ago

[SOLVED] wildcard usage problem in assertion

hi,

we have a response with multiple items where we need to add wildcards to the assertions. here is the response structure:


   
      I001
      ...
      2009.10.31
      HOTGP
      2009.02.12
   

   
      I002
      ...
      2009.10.11
      HOTGP
      2009.10.12
   



when we now add assertions for each item, check use wildcards and replace the dates with a star the assertion for the first item looks like this:

  I001
   ...
   *
   HOTGP
   *

and the assertion works fine.

but as soon as we add the 2nd assertion for the 2nd item with the wildcards this assertion is always red as soon as we add the * for Date2:

   I002
   ...
   *
   HOTGP
   *


please have a look.

regards,
Chris

5 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    I was not able to reproduce it, can post whole response so I can try. I created this response:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.aaa.com">
      <soapenv:Header/>
      <soapenv:Body>
          <a:Items>
            <a:DCResultItem>
                <Code>I001</Code>
                <Date1>2009.10.31</Date1>
                <xyz>HOTGP</xyz>
                <Date2>2009.02.12</Date2>
            </a:DCResultItem>
            <a:DCResultItem>
                <Code>I002</Code>
                <Date1>2009.10.11</Date1>
                <xyz>HOTGP</xyz>
                <Date2>2009.10.12</Date2>
            </a:DCResultItem>
          </a:Items>
      </soapenv:Body>
    </soapenv:Envelope>


    and these are assertions:

    // xpath
    declare namespace a='http://www.aaa.com';
    //a:Items/a:DCResultItem

    // expected
    <a:DCResultItem xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.aaa.com">
      <Code>I001</Code>
      <Date1>*</Date1>
      <xyz>HOTGP</xyz>
      <Date2>*</Date2>
    </a:DCResultItem>

    // for second element
    <a:DCResultItem xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.aaa.com">
      <Code>I002</Code>
      <Date1>*</Date1>
      <xyz>HOTGP</xyz>
      <Date2>*</Date2>
    </a:DCResultItem>



    Let me know does it helps,
    robert