You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sunondo Ghosh <su...@covigna.com> on 2003/06/13 03:37:35 UTC
Urgent: Question about changing URL of new request based on previous response
I have been playing around with JMeter and it looks
like a very cool tool. Thanks to all the developers
behind it.
I am using JMeter v 1.8.1 on Windows 2000. I have a
question about creating a URL based on some data in the
previous response. I need to get an answer to this by
tomorrow otherwise I will need to try some other tool
or hack our code to do the testing! :-( I went through
the user manual and some previous questions on the
jmeter-user mailing list but could not get an answer to
this.
I am sending a request which should contain the
following data in the response:
<a
href="contract.terms.ViewTermDetails.do?init=true&contractHandle=$7.3e">OpalBaseForm</a>
I checked in the View Results tree and the response
indeed contains that. Now I want to extract the value
$7.3e from this response and use it in the next HTTP
request as follows:
/opal/contract.terms.ViewTermDetails.do
with the Parameters
init=true and
contractHandle=$7.3e
I created a new HTTP request with
Path=/opal/contract.terms.ViewTermDetails.do and two
paramters with the second parameter as follows:
Name=contractHandle;
Value=${__regexFunction(%3Ca+href%3D%22contract.terms.ViewTermDetails.do%3Finit%3Dtrue%26contractHandle%3D%28.*%29%22%3E,%241%24,1,,,contractHandle)}
which is a function created from the regular expression
<a
href="contract.terms.ViewTermDetails.do?init=true&contractHandle=(.*)">
Template=$1$
Match=1
Name of function=contractHandle
This did not work. Then I tried to insert the regular
expression function in a response assertion (suggestion
in another mail) just following the first request and
inserted ${contractHandle} in place of the Value for
the contractHandle parameter. This did not work either.
At this point my test plan is:
| Http Request 1
-- Response Assertion
| Http Request 2
Next I inserted an Assertion Results following the
first request and inserted the same function.
| Http Request 1
-- Response Assertion
-- Assertion Results
| Http Request 2
The assertion results does not give an error which
means the regular expression is being matched. Still
the Http Request 2 goes out as follows:
http://.../contract.terms.ViewTermDetails.do?init=true&contractHandle=${contractHandle}
I tried this also. Still doesn't work.
| Http Request 1
| Response Assertion
| Assertion Results
| Http Request 2
What am I doing wrong? Is there any other way to do
what I want? I will really appreciate any help.
Thanks,
Sunondo
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org