Jump to content
WAPT Forum
Sign in to follow this  
Guest AJThomas

Variable in "POST raw data"

Recommended Posts

Guest AJThomas

I am testing a web service and using the "POST raw data" option to supply the XML. I need to generate a random charactrer string in each request, but so far I have not managed to generate one using any of the functions.

 

So how do I generate a random character string within the XML message?

 

Thanks in advance

Share this post


Link to post
Share on other sites
Guest angela
I am testing a web service and using the "POST raw data" option to supply the XML. I need to generate a random charactrer string in each request, but so far I have not managed to generate one using any of the functions.

 

So how do I generate a random character string within the XML message?

 

Thanks in advance

 

You can do this wih he function $Var. You need to crete a variable, initialize it with this functon and substitute its value in the row data.

Share this post


Link to post
Share on other sites
Guest AJThomas
You can do this wih he function $Var. Yoiu need t crete avariable, initialize it with this functon and substitute its value in the row data.

 

 

Hi,

 

I can create a variable, but it is just blank when it runs.

I create the variable called RandomText using $ARand(32,32) then in my XML I use <text>$Var(RandomText)</text> but when this runs I just get <text></text>.

 

Looking at your suggestion I don't really understand how to "initialize it" and how to "substitute its value", where am I going wrong?

 

 

Thanks again.

Share this post


Link to post
Share on other sites
Guest angela
Hi,

 

I can create a variable, but it is just blank when it runs.

I create the variable called RandomText using $ARand(32,32) then in my XML I use <text>$Var(RandomText)</text> but when this runs I just get <text></text>.

 

Looking at your suggestion I don't really understand how to "initialize it" and how to "substitute its value", where am I going wrong?

 

 

Thanks again.

 

You've done everything correctly, except one thing: you need to create a variable in the previous request.

 

I.e., you create a variable in requst #1, you can use it in request #2.

 

 

Share this post


Link to post
Share on other sites
Guest AJThomas
You've done everything correctly, except one thing: you need to create a variable in the previous request.

 

I.e., you create a variable in requst #1, you can use it in request #2.

 

 

OK. that's a problem, we only have one request.

 

How would I set up a dummy request that does nothing but set up a variable?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×