views:

55

answers:

1

How can I create variable from a response data. I want to create variable n1 which will get the value from variable v1, because v1 is diynamic variable.Response part:

q=q.replace("v1=2780");

+1  A: 

Can you clarify your question a little? is "v1" a JMETER variable, or a variable in the program you are testing?

It sounds like you want to use a regular expression to extract the value of v1 and save the results as jmeter variable n1.

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Regular_Expression_Extractor

BlackGaff
v1 is variable in response data of JMeter (or embeded javascript response). And n1 will be JMeter variable which will get value from v1.
Gogoo
Use a regex. I would recommend downloading "the Regex Coach" to help write your regular expression. It uses PERL, and this site is a fantastic resource: http://www.regular-expressions.info/
BlackGaff