silk_route11
silk_route11

Reputation: 344

Extract Entire(a single string) response Using JMeter

I am testing a site using JMeter. I am creating a GET request for getting an account number by an unique id. Which returns only the account number(in String). How can I get the account number in to a Reference Name of JMeter extractor?

Upvotes: 1

Views: 2060

Answers (2)

vins
vins

Reputation: 15400

As you say the response has only the Account Number you are looking for,

Use a Beanshell post processor,

 vars.put("ACCOUNTNUMBER", prev.getResponseDataAsString());

Then you can use ${ACCOUNTNUMBER} , in your test to get the value.

Upvotes: 0

Nidheesh
Nidheesh

Reputation: 672

Use Regular Expression Extractor.

Add Regular expression extractor (under Post Processors) as a child of your request. Provide Reference Name of your choice. Provide Regular expression as (.+?).

Upvotes: 1

Related Questions