Jump to content


Variable in "POST raw data"


  • Please log in to reply
4 replies to this topic

#1 Guest_AJThomas_*

Guest_AJThomas_*
  • Guests

Posted 01 October 2009 - 09:38 AM

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

#2 Guest_angela_*

Guest_angela_*
  • Guests

Posted 01 October 2009 - 12:37 PM

QUOTE (AJThomas @ Oct 1 2009, 04:38 PM) <{POST_SNAPBACK}>
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.

#3 Guest_AJThomas_*

Guest_AJThomas_*
  • Guests

Posted 01 October 2009 - 03:24 PM

QUOTE (angela @ Oct 1 2009, 01:37 PM) <{POST_SNAPBACK}>
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.

#4 Guest_angela_*

Guest_angela_*
  • Guests

Posted 02 October 2009 - 09:41 AM

QUOTE (AJThomas @ Oct 1 2009, 10:24 PM) <{POST_SNAPBACK}>
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.



#5 Guest_AJThomas_*

Guest_AJThomas_*
  • Guests

Posted 06 October 2009 - 07:34 AM

QUOTE (angela @ Oct 2 2009, 10:41 AM) <{POST_SNAPBACK}>
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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users