cancel
Showing results for 
Search instead for 
Did you mean: 

Merging of Multiple Properties

Merging of Multiple Properties

I have a series of fields that are used repeatedly throughout my project. Some of which are combined to create new fields:

 

FirstName: James

LastName: Dean

 

If I want to combine these properties to create a new property 'Name', how can this be done?

 

Would creating a new property called: Name

with the value: ${FirstName}&' '&${LastName}

work?

 

I want 'James Dean' to be given in the request.

 

Any answers gratefully received.

 

Thanks

1 REPLY 1
Contributor

Re: Merging of Multiple Properties

You could use property expansion like this ${#Project#firstname}, basically #Project or TestSuite or TestCase#<propertyname>, see also here click me.

 

So if the fields are set on the project itself, use it like this:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header/>
   <soap:Body>
      <name>${#Project#firstname} ${#Project#lastname}</name>
   </soap:Body>
</soap:Envelope>

This will result in request looking like this:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header/>
   <soap:Body>
      <name>James Dean</name>
   </soap:Body>
</soap:Envelope>

In groovy script it is slightly more convoluted, as you have to type context.expand('${#Project#firstname}').

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win