Forum Discussion

RJanecek's avatar
RJanecek
Regular Contributor
13 years ago

getting data from DataSource

hi,

I wanna get data from datasource: context.expand( '${DataSource#elemnt}' ) when this coloumn return nothing it return "" not null is possible change something to return null if column return nothing ?

6 Replies

  • RJanecek's avatar
    RJanecek
    Regular Contributor
    so nobody know ? because this is big bug when I have in database null and datasource return "" and not null ?!?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    null value is treated as empty string. If you want to ignore it you can do it by checking setting "Goto on Loop on Empty" in DataSource to skip null values.

    Hope this helps,
    robert
    /SmartBear
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    no I dont wanna ignore null value I need null value. When I have in database null I wanna assert this for null and when I have empty string in database I wanna assert empty string.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you are correct - this is a bug due to the nature of how soapUI handles properties - essentially there is no "null" possibility - please file a bug-report in the Bugs Forum and we will log and prioritize it accordingly.

    regards!

    /Ole
    SmartBear Software
  • Was this issue resolved or is there a workaround? We have a get method where we need to assert that the data that is being fetched matches the data in our db but are running into the columns that are null.
  • Just figured out a way around this issue. In the assertion, use the xpath concatenation function which returns the concatenation of the strings.

    for example:

    declare namespace ns1='blah';
    concat(//ns1:thelocation, "")