Highlighted
Absent Member.. Absent Member..
Absent Member..
180 views

Get a Value from a Webpage

Hi, I'm using web_reg_save_param("DC1","LB=time","RB=Dis","Ord=All","Search=body",LAST); to grab all the policy number from a webtable on our site. I need to now assign these values exclusively to each Vuser doing our run so that no 2 Vusers will grab the same account number. Can someone help me on this one?
0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Get a Value from a Webpage

Hawesch,

In your VUgen help:

HP LoadRunner Virtual User Generator User's Guide > Working with VuGen > File, Table, and XML Parameter Types > Choosing Data Assignment Methods for File/Table Parameters

The Unique method assigns a unique sequential value to the parameter for each Vuser.

In this case you must make sure there is enough data in the table for all the Vusers and their iterations. If you have 20 Vusers and you want to perform 5 iterations, your table must contain at least 100 unique values.


Hope this helps.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Get a Value from a Webpage

James, My values are not within the Parameters file but in a table on the webpage I'm accessing. Hence I'm I'm using web_reg_save_param to retrieve them.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Get a Value from a Webpage

Hi Hawesh,
1.
the list you get back from the "web-reg-save_param", is it always the same or does it give random Policy numbers back ? When it doesn't change a solution could be,
You need to add code in your script to save the policy numbers(array). Also find out how many(Policynumber_count) table items there are to see how many iterations you can do. In this way it is possible to pick unique policy numbers, in a sequential way from the array until the max number is hit. In every iteration give the number exclusively to a Vuser.
2.
When you can find a unique sequential number identification in your web_reg_parm table for every policy number you get back, do update your Left or right boundary in the web_reg_param, using for example a sequential parameter in your boundery to pick the "next" unique number. But accoording to your guestion this is maybe to simple.

Greets,
Quality Utd
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Get a Value from a Webpage

Hi, this is the code I'm using so far. It seems to still not work. Can you directory me in what is incorrect about the code?

web_reg_save_param("DC1PlcyRefNum",
"LB=$lnkShowDocument", "", true, "", "", false, true))\">",
"RB=",
"Ord=ALL",
"Search=body",
LAST);

//get number of matches
PolicyCount = atoi(lr_eval_string("{DC1PlcyRefNum_count}"));

for (i = 1; i <= PolicyCount; i++) {

}
return 0;
}
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.