Ask a Question

Post: How to replace the variables in attachment

TerryHe
New Contributor

Post: How to replace the variables in attachment

I defined following in groovy script

=============

vars["sg"] = "sg1"
context.vars = vars

=============

 

If the POST request is "application/xml", i can use "${=vars.sg}" to access the real value.

 

While if the POST request is an attachment file with "mustipart/form-data", the value did not get replaced!!

===========================
<SessionGroup>${=vars.sg}</SessionGroup>

===========================

 

How can i replace the value in the attachment file

3 REPLIES 3
TanyaYatskovska
Community Manager

Re: Post: How to replace the variables in attachment

 

Hi Terryhe,

 

 

Do you want to replace value inside the attached file? If you do, I don't think this is possible to do. If I misunderstood your task, please clarify it.

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
nmrao
Community Hero

Re: Post: How to replace the variables in attachment

If it is the case, you may have modify the file content and save the file prior to send the request.


Regards,
Rao.
TerryHe
New Contributor

Re: Post: How to replace the variables in attachment

Hi Tanya Gorbunova,

 

You are right, the file content would contain the variables and i want to replace it.

 

If this is not supported, i think the only way is to use something else like "groovy" to generate the request and send it, right?

 

Thanks!

Terry

cancel
Showing results for 
Search instead for 
Did you mean: