tags:

views:

70

answers:

2

Hello,

I am using web.custom_request() Java Web Vuser function to send a request to server. Now I want to know how can I capture the response in my Vuser script?

I am not able to successfully do it using web.reg_save_param() Java Web Vuser function.

Any pointers are appreciated.

Thank you Chaitanya

A: 

I got it myself.

I used the following piece of code:

web.reg_save_param("Response",new String []{"LB=","RB=","LAST"});
...
...
...
 String response = lr.eval_string("<Response>");
Chaitanya MSV
A: 

I don't see the point of your second statement: "String response = lr.eval_string("");"

The parameter is already stored as a string. You can use lr.eval_string to use it anywhere down the line.

Bash
Well fetching the result parameter's value into a local variable once and referencing the local variable is better than using lr.eval_string on every occasion where you want to reference the value because lr.eval_string is quite expensive (it allocates a string buffer which is kept until the iteration ends), I think.
TheBlastOne