Forum Discussion

ssingh1's avatar
ssingh1
New Contributor
10 years ago

How to automate optional fields in SOAP UI and get rid of FieldName='' ?

Hi All , 

 

I am working on a project where we are automating the Web services testing . Most of the time my approach is 

1. Seed Data

2. fetch Dataset from Excel (it will be used in operation paramenters)

3. Execute the operation on the seeded data in step 1

4. Validate the results.

5  Loop to second step

 

The above approach works fine for a set of fields but I am not able to find a convinient approach for optional fields. For example , if I have fields like

FirstName,

LastName,

Age,

EmployeeNumber,

Address

 

and all those are optional . and I want to check the combinations like 

1. If used sent all the fields except firstname

2. User sent all the fields except lastname etc

 

But if I keep the same SOAP structure , I will get FirstName="" and my schema validation will fail . what I am looking for is a way so that if I pass a value it appears as FirstName="Test" if I do not pass then the attribute does not show at all.

 

Please let me know your thoughts

Thanks