Yagya Sharma
Yagya Sharma

Reputation: 437

Correlation in different lines -- LoadRunner 11 - protocol http/html

Correlation is on different lines when select LB and RB getting message - Invalid selection selected value cannot be greater than one line. So in script I am capturing all lines in different parameters as below web_reg_save_param("Corr_P1", "LB=![CDATA[", "RB=\n", "Ord=1", LAST);

similarly I am capturing parameters on different lines -

web_reg_save_param("Corr_P2", "LB=<token>![CDATA[", "RB=\n", "Ord=1", LAST);
web_reg_save_param("Corr_P3", "LB\n", "RB=\n", "Ord=24", LAST);
web_reg_save_param("Corr_P4", "LB=\n", "RB=\n", "Ord=25", LAST);
web_reg_save_param("Corr_P5", "LB=\n", "RB=\n", "Ord=26, LAST);
web_reg_save_param("Corr_P6", "LB=\n", "RB=\n", "Ord=27", LAST);

During recording values are coming on all 6 lines. But during replay value in Corr_P5 is blank. Hence it is failing. Please suggest what could be problem and provide me a solution.

So I want to get these values in a variable and concatenate it. But it is not working. Can someone please give a sample code in C to address this.

Thanks in advance.

Regards,

Yagya

Upvotes: 0

Views: 6322

Answers (3)

Htomi
Htomi

Reputation: 26

Probably a bit late but in your script you are missing the closing quotation mark for P5: maybe that would make the difference. Good luck

Upvotes: 1

K.Sandell
K.Sandell

Reputation: 1394

Capturing data with

web_reg_save_param("Corr_P6", "LB=\n", "RB=\n", "Ord=?", LAST);

captures the exact LINE number. This will be problematic especially when you have dynamic data. It's enough to have one more HTTP Header or an extra \n somewhere and your code will fail.

From the ![CDATA in the 1st line I assume that the data returned from the server is XML. In this case I would capture the whole output and parse it with XML functions:

web_reg_save_param("XML","LB=","RB=","Search=Body",LAST); // Take whole BODY

// Get a value from <tag1></tag2><tagN>data</tagN></tag2></tag1>
lr_xml_get_values("XML={XML}", "ValueParam=Corr_Px", "Query=/tag1/tag2/tagN", "NotFound=Continue", LAST);

LoadRunner has some nice XML Functions, just search in the help for those.

Upvotes: 2

James Pulley
James Pulley

Reputation: 5692

Did you try "LB=/n","RB=/n", "ORD=ALL" to see what is actually being returned

Upvotes: 0

Related Questions