WAPT Forum: Inserting variable value into Static Text - WAPT Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Inserting variable value into Static Text

#1 User is offline   Matt01SS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 01-July 09

Posted 15 July 2009 - 09:39 PM

I was curious if there was a way to insert variable values into a static text parameter. In our program we submit a parameter which contains xml data representing data nodes for records. (Ex. <record><guid>ABCDEF</guid></record>) In this example, the program will know that it is record ABCDEF that is being updated. For my WAPT profile, the page along with the parameter gets submitted, however the "<guid>" value changes everytime a new record is created.

Basically, I need a way to do something like this: "<record><guid>$CurrentGUID</guid></record>". However, when I try something like that, the actual request keeps the variable name in there instead of switching it out for the variable's value.

Is there a better way to do this??
0

#2 User is offline   angela 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 373
  • Joined: 12-February 08
  • Gender:Female
  • Location:Novosibirsk

Posted 17 July 2009 - 11:38 AM

QUOTE (Matt01SS @ Jul 16 2009, 04:39 AM) <{POST_SNAPBACK}>
I was curious if there was a way to insert variable values into a static text parameter. In our program we submit a parameter which contains xml data representing data nodes for records. (Ex. <record><guid>ABCDEF</guid></record>) In this example, the program will know that it is record ABCDEF that is being updated. For my WAPT profile, the page along with the parameter gets submitted, however the "<guid>" value changes everytime a new record is created.

Basically, I need a way to do something like this: "<record><guid>$CurrentGUID</guid></record>". However, when I try something like that, the actual request keeps the variable name in there instead of switching it out for the variable's value.

Is there a better way to do this??



It seems, no. A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var.
Angela Samsonova
Customer Support Manager
SoftLogica LLC.

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com
0

#3 User is offline   Matt01SS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 01-July 09

Posted 17 July 2009 - 05:51 PM

QUOTE (angela @ Jul 17 2009, 07:38 AM) <{POST_SNAPBACK}>
It seems, no. A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var.


So theres no workaround for inserting variable data into the static text?
0

#4 User is offline   angela 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 373
  • Joined: 12-February 08
  • Gender:Female
  • Location:Novosibirsk

Posted 20 July 2009 - 12:16 PM

QUOTE (Matt01SS @ Jul 18 2009, 12:51 AM) <{POST_SNAPBACK}>
So theres no workaround for inserting variable data into the static text?



It seems that you misunderstood my answer to your question. I meant that for inserting variable data into the static text you should use the functions $Search and $Var:

"A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var".
Angela Samsonova
Customer Support Manager
SoftLogica LLC.

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com
0

#5 User is offline   Matt01SS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 01-July 09

Posted 20 July 2009 - 03:32 PM

QUOTE (angela @ Jul 20 2009, 08:16 AM) <{POST_SNAPBACK}>
It seems that you misunderstood my answer to your question. I meant that for inserting variable data into the static text you should use the functions $Search and $Var:

"A value is extracted by function $Search and saved into the variable, then the value placed into the right place by function $Var".


I'm sorry I still can't quite follow what you are saying. How am I supposed to use the $Search or $Var functions when I'm already using the Static Text function. I don't see how you use the $Var function within the Static Text function. When I tried doing, <guid>$Var</guid>, the request did not replace $Var with a value, it actually used $Var as text. (ie. the program submitted <guid>$Var</guid> instead of <guid>123</guid>)
0

#6 User is offline   angela 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 373
  • Joined: 12-February 08
  • Gender:Female
  • Location:Novosibirsk

Posted 21 July 2009 - 11:35 AM

QUOTE (Matt01SS @ Jul 20 2009, 10:32 PM) <{POST_SNAPBACK}>
I'm sorry I still can't quite follow what you are saying. How am I supposed to use the $Search or $Var functions when I'm already using the Static Text function. I don't see how you use the $Var function within the Static Text function. When I tried doing, <guid>$Var</guid>, the request did not replace $Var with a value, it actually used $Var as text. (ie. the program submitted <guid>$Var</guid> instead of <guid>123</guid>)


Now we understand. You need to create a parameter using 3 functions: Static text, $Var and Static text (as it is shown on the picture below).


Attached File  parameter.PNG (17.29K)
Number of downloads: 71


Angela Samsonova
Customer Support Manager
SoftLogica LLC.

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com
0

#7 User is offline   angela 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 373
  • Joined: 12-February 08
  • Gender:Female
  • Location:Novosibirsk

Posted 21 July 2009 - 12:07 PM

QUOTE (angela @ Jul 21 2009, 06:35 PM) <{POST_SNAPBACK}>
Now we understand. You need to create a parameter using 3 functions: Static text, $Var and Static text (as it is shown on the picture below).


Attached File  parameter.PNG (17.29K)
Number of downloads: 71


In other words, you need to combine several functions in one parameter. I.e. the parameter will be defined not by one function, but by 3 functions: the 1st part of the text in the 1st Static text function, then $Var function, and then the 2nd part of the text in the 2nd
Static text function.
Angela Samsonova
Customer Support Manager
SoftLogica LLC.

Office: +7-383-335-6692
Toll-free: 1-888-364-6797 (for US only)
Time zone GMT +6, EST +11
E-mail: support@loadtestingtool.com
http://www.loadtestingtool.com
0

#8 User is offline   Matt01SS 

  • Member
  • PipPip
  • Group: Members
  • Posts: 16
  • Joined: 01-July 09

Posted 21 July 2009 - 03:25 PM

That worked beautifully! Thank you for the "work-around", I didn't know that adding multiple functions would concatenate together to make one value. Just what I was looking to do.

Thank You,
Matt
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users