getting data from DataSource

soapUI pro announcements and discussions

getting data from DataSource

Postby RJanecek » 16 Sep 2011 08:31

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 ?
RJanecek
Full Member
Full Member
 
Posts: 202
Joined: 02 Sep 2010 15:57

Re: getting data from DataSource

Postby RJanecek » 20 Sep 2011 14:06

so nobody know ? because this is big bug when I have in database null and datasource return "" and not null ?!?
RJanecek
Full Member
Full Member
 
Posts: 202
Joined: 02 Sep 2010 15:57

Re: getting data from DataSource

Postby SmartBear Support » 21 Sep 2011 15:31

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
SmartBear Support
Administrator
Administrator
 
Posts: 6791
Joined: 16 Feb 2009 10:53

Re: getting data from DataSource

Postby RJanecek » 21 Sep 2011 16:39

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.
RJanecek
Full Member
Full Member
 
Posts: 202
Joined: 02 Sep 2010 15:57

Re: getting data from DataSource

Postby SmartBear Support » 22 Sep 2011 23:39

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
SmartBear Support
Administrator
Administrator
 
Posts: 6791
Joined: 16 Feb 2009 10:53

Re: getting data from DataSource

Postby Holly Greger » 23 Mar 2012 14:15

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.
Holly Greger
soapui pro users
soapui pro users
 
Posts: 33
Joined: 20 May 2010 14:47
Location: Weston, FL

Re: getting data from DataSource

Postby Holly Greger » 23 Mar 2012 14:35

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, "")
Holly Greger
soapui pro users
soapui pro users
 
Posts: 33
Joined: 20 May 2010 14:47
Location: Weston, FL


Return to soapUI Pro Support