Forum Discussion

TheWarden's avatar
TheWarden
Occasional Contributor
16 years ago

Excel Datasource - Null values

Hi,
I am using SoapUI pro 2.5.  I also love it!

I have a question.


I am using the Excel Data source feature to load my test steps with data for the request parameters and assertions.  The request returns a Null value in one of the response elements.  My assertions are failing on the Null value

I have not found a way either enter a Null value in Excel for SoapUI to pick up or have SoapUI recognize a blank cell from Excel as a null value.

Any assistance you can provide would be appreciated.

7 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm... can you show the actual xml in your response with the null value and the corresponding xpath you are using to assert it?

    regards!

    /Ole
    eviware.com
  • TheWarden's avatar
    TheWarden
    Occasional Contributor
    Here is a sample of a response and the xpath assertion.  I don't know what value to enter into my excel datasource to equal the xpath expected result listed below.

    Response:
           
                0
                The operation completed successfully
                0
               
                0
                abc1
           


    Declare:
    declare namespace ns3='http://…/common/service/response/type/v0x00';
    declare namespace ns2='http://…/message/v0y00';
    //ns2:retrieveMyResponse[1]/ns2:response[1]/ns3:exceptionMessage[1]

    Expected Results:
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm.. what if you append "/text()" to the xpath expression.. what do you get for expected result?

    ie

    declare namespace ns3='http://…/common/service/response/type/v0x00';
    declare namespace ns2='http://…/message/v0y00'; //ns2:retrieveMyResponse[1]/ns2:response[1]/ns3:exceptionMessage[1]/text()

    regards!

    /Ole
    eviware.com
  • TheWarden's avatar
    TheWarden
    Occasional Contributor
    The addition of "Text()" caused an error in the assertion:

    XPathContains assertion failed for path [declare namespace ns3='http://.../common/service/response/type/v0100'; declare namespace ns2='http://.../message/v0300'; //ns2:MyResponse[1]/ns2:response[1]/ns3:exceptionMessage[1]/Text()] : RuntimeException:net.sf.saxon.trans.XPathException: XPath syntax error at char 92 on line 2 in {...ns3:exceptionMessage[1]/Tex...}: Unknown system function Text()

    Thanks in advance
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    it's case-sensitive, use a small 't' in "text()" (not "Text()")

    regards!

    /Ole
    eviware.com
  • TheWarden's avatar
    TheWarden
    Occasional Contributor
    ok, I changed the case, but I am still receiving the assertion error:


    XPathContains assertion failed for path [declare namespace ns4='http://.../common/service/response/type/v0x00'; declare namespace ns2='http://.../message/v0y00'; //ns2:retrieveMyDataResponse[1]/ns2:response[1]/ns4:exceptionMessage[1]/text()] : Exception:Missing content for xpath [declare namespace ns4='http://.../common/service/response/type/v0x00'; declare namespace ns2='http://.../message/v0y00'; //ns2:retrieveMyResponse[1]/ns2:response[1]/ns4:exceptionMessage[1]/text()] in Response

    Note: the assertion error only occurs when I run using the Excel Datasource.  If I perform a manual request the xpath assertion works (w/ the text()).

    Thanks in advance.