[Resolved] empty elements in data driven test sent

SoapUI Pro announcements and discussions

[Resolved] empty elements in data driven test sent

Postby Logica BV Support » 21 Feb 2012 14:20

I am currently working on an data driven test set.

The only thing is the data in the excel sheet does not always contain all fields.
So if a field is empty it will be sent out as empty. This will in our case give an error.
Is there a way to prevent empty elements from being sent out ?
Logica BV Support
User
 
Posts: 4
Joined: 16 Feb 2012 19:54

Re: empty elements in data driven test sent

Postby SmartBear Support » 21 Feb 2012 15:18

Hi,

you can prevent this only if the whole row is empty but not in the case of single empty value in row.
To achieve this just check "Ignore Empty" check box in Data Source (Excel) configuration.

Hope this helps

regards
nebojsa
SmartBear Software
SmartBear Support
Administrator
Administrator
 
Posts: 8733
Joined: 16 Feb 2009 10:53

Re: empty elements in data driven test sent

Postby Logica BV Support » 21 Feb 2012 15:57

Is there no way at all ? scripting/filtering/event or whatever to do this?

Regards, Rob
Logica BV Support
User
 
Posts: 4
Joined: 16 Feb 2012 19:54

Re: empty elements in data driven test sent

Postby M McDonald » 21 Feb 2012 15:58

Since you can put script directly into a request, try this for each element that could be empty:

Code: Select all
${=context.expand("${DataSource#field1}")!=''?'<field1>'+context.expand("${DataSource#field1}")+'</field1>':''}
M McDonald
soapui pro users
soapui pro users
 
Posts: 625
Joined: 21 Feb 2008 00:04
Location: New York

Re: empty elements in data driven test sent

Postby Logica BV Support » 22 Feb 2012 09:11

Yes but this causes the field to be sent out.
I just dont want it in the outgoing message.

<field1>value</field1>
<field2></field2>
<field3>value</field3>

This is not what i iwant.

I want:

<field1>value</field1>
<field3>value</field3>
Logica BV Support
User
 
Posts: 4
Joined: 16 Feb 2012 19:54

Re: empty elements in data driven test sent

Postby M McDonald » 22 Feb 2012 13:09

Seems to work for me (see screenshot- I just posted to a service that echoes back what I send.)

Did you remove the tags for the field from the request as well?
Attachments
empty.jpg
empty.jpg (109.28 KiB) Viewed 1147 times
M McDonald
soapui pro users
soapui pro users
 
Posts: 625
Joined: 21 Feb 2008 00:04
Location: New York

Re: empty elements in data driven test sent

Postby Logica BV Support » 22 Feb 2012 13:28

This explains it all to me .... Thank you very much
or in swedish : tack så mycket
Logica BV Support
User
 
Posts: 4
Joined: 16 Feb 2012 19:54

Re: [Resolved] empty elements in data driven test sent

Postby RTiwari » 26 Mar 2012 06:47

Hi all ,
Is there is any other solution to resolve this issue by using the SOAP request ?
Its urgent.
Please do the needful .
RTiwari
User
 
Posts: 5
Joined: 27 Feb 2012 14:53


Return to SoapUI Pro Support