Forum Discussion

Logica_BV_Suppo's avatar
Logica_BV_Suppo
New Contributor
14 years ago

[Resolved] empty elements in data driven test sent

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 ?

7 Replies

  • 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
  • Is there no way at all ? scripting/filtering/event or whatever to do this?

    Regards, Rob
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Since you can put script directly into a request, try this for each element that could be empty:

    ${=context.expand("${DataSource#field1}")!=''?'<field1>'+context.expand("${DataSource#field1}")+'</field1>':''}
  • 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>
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    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?
  • RTiwari's avatar
    RTiwari
    Occasional Contributor
    Hi all ,
    Is there is any other solution to resolve this issue by using the SOAP request ?
    Its urgent.
    Please do the needful .