Forum Discussion

Chiam_c's avatar
Chiam_c
Occasional Contributor
10 years ago

JBDC response does not return an "" when element does not exist

I have a test that uses multiple jbdc elements using sql to get information from our database.  

The information is then used in a data sink that pulls the response directly from the ResponseAsXml from said jbdc.

The problem that i am encountering is that in the older version of soapui pro the data sink equated a response from the jbdc where the element did not exist as null or an empty string. 

Now with SoapUI NG Pro the datasink is placeing the value ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SOURCE[1]} into the output file instead of "".

 

Is there an assertion or something i can add to my test steps to correct this issue as this change basically breaks my entire program as the output from the datasink is used as a datasource for multiple other test suites.  

The only other think i can think of to correct this is to create a groovy script that would replace the incorrect string with an emptry string or null but how can i get the datasink to pick that up?

 

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Chiam_c,

     

    Are you using Ready! API 1.4.1? If you aren’t, please check what value is returned in this product version.

    From my understanding, all product versions should return the same value due to the backward compatibility.

  • Chiam_c's avatar
    Chiam_c
    Occasional Contributor

    Upon checking the version of ready api that we are currently useing i find the following information:

    Ready! API 1.4.1
    © SmartBear Inc. 2007-2015
    http://www.smartbear.com

      So yes the version is 1.4.1

    as far as the information returned 

    the datasink for soapui ng pro has the following information set as name / value for one of the  fields:

    PLUS ONE / ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/DEVICE_ID[1]}

    and the datasink for soapui pro (5.1.1) has the following information set as name / value for the same field 

    PLUS ONE / ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/DEVICE_ID[1]}

    as you can see they are the same.

     

    with the same exact data source file the programs returns different results.

    SoapUI NG Pro returns :

    (accountnumber),(resource),(source),(stateid), (resource2), (source), (stateid), (resource3), (source), (stateid) ,

    ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/DEVICE_ID[1]},

    ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/SOURCE[1]},

    ${SQL Query - PLUS1#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/DECODEPIN.DEVICE_T.STATE_IDNULL1RESERVED2ACTIVE3INACTIVEOTHER-PIN.DEVICE_T.STATE_ID[1]}

     

    where as SoapUI Pro returns:

    (accountnumber),(resource),(source),(stateid), (resource2), (source), (stateid), (resource3), (source), (stateid) ,,,

     

    as some of the resources may or may not exist on any given account it is actually very important to keep track of that fact.

     

    If i was to add a grovy script to remove the incorrect information i am assuming that i would,

    1.use a regex to locate the text to remove from the file itself

    2.replace the text with a ""

     

    so would this be done after the datasink and before the datasource loop or would i want to do that in a while or loop statement after the datasource loop?

    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Hi Chiam_c,

       

      Thanks for checking the version. I’ve passed this information to our QA team so that they could test the results returned by SoapUI and SoapUI NG. Once I get the news from them, I’ll post here.