Forum Discussion

Bob's avatar
Bob
Contributor
16 years ago

set property test step value to null

I have a number of test cases which contain properties.

I need some of those property values to be null.  How can I do this.  If I just leave them blank and try to assert on them them assertions fails because soapUI reports:

-> XpathContains Comparison failed, expecting [], actual was [null].

Anyone know how to overcome this?

5 Replies

  • May be just put Null in the excepted result because the null string is the natural string representation of a null object
  • Bob's avatar
    Bob
    Contributor
    mlenosgrande wrote:

    May be just put Null in the excepted result because the null string is the natural string representation of a null object


    If I do that I get this:

    -> XpathContains Comparison failed, expecting [null], actual was [null].
  • Bob's avatar
    Bob
    Contributor
    That post must be in the pro section which I do not have access to - could you summarise for me?
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Sure. I just used the following to make sure I got an empty string on the actual result:

    concat(//myxpath/text(),"")