cancel
Showing results for 
Search instead for 
Did you mean: 

Using property expansion in header param does not work

SOLVED
Highlighted
Occasional Contributor

Using property expansion in header param does not work

I have set a custom property 'token' at the project level and would like to use that value in a header param.

 

I am putting this into a header param value field:

 

${#projectname#token}

 

It is not grabbing that custom property value I set at the project level. Doing something wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Hi @anagai,

Search for "soapui property expansion" and pick the first link returned. This explains that youre adding an extra hash # character erroneously.

The syntax required is as follows:

If you use '${#Project#propertyname}' so the value that goes between the two # values is the 'scope' or level of where the property is stored. So 'scope' would be 'Project' or 'TestSuite' or 'TestCase' etc., NOT 'Projectname' nor 'TestSuitename' nor 'TestCasename'.

Whereas if you are specifying the name of project rather than just indicating the scope, you only use a single # character.

E.g. ${Projectname#propertyname}

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

4 REPLIES 4
Community Hero

Hi @anagai,

Search for "soapui property expansion" and pick the first link returned. This explains that youre adding an extra hash # character erroneously.

The syntax required is as follows:

If you use '${#Project#propertyname}' so the value that goes between the two # values is the 'scope' or level of where the property is stored. So 'scope' would be 'Project' or 'TestSuite' or 'TestCase' etc., NOT 'Projectname' nor 'TestSuitename' nor 'TestCasename'.

Whereas if you are specifying the name of project rather than just indicating the scope, you only use a single # character.

E.g. ${Projectname#propertyname}

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta

View solution in original post

Highlighted
Occasional Contributor

I didn't find that doc when searching google. All the other sites say ${#Project#Name}  . I thought Project was project name. Looks like a placeholder to me.

Highlighted
Occasional Contributor

I actually need ${#TestSuite#Name} - I want to place my custom property in the containing test suite. Thanks for pointing me in the right direction.

Highlighted
Community Hero

Hey

My bad. If you google "property expansion in soapui" youll see the first page returned gives you the help page i was talking about

Nice one

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors