Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

Parameterizing parameter file

$
0
0

 

I am working on a scenario where I have 3 user contexts. Each user will need to submit data 5 times. Each submit data will have 4 different values.

I could handle the 3 user logins with parameterization

  web_submit_data("login",
    "Action=.../login",
    "Method=POST",
    "RecContentType=text/html",
    "Referer=",
    "Snapshot=t4.inf",
    "Mode=HTML",
    ITEMDATA,
    "Name=utf8", "Value=...“", ENDITEM,
    "Name=token", "Value={token}", ENDITEM,
    "Name=id", "Value={UserId}",ENDITEM,
    "Name=pwd", "Value=Somepwd", ENDITEM,

LAST);

To submit data 5 times, I did a for loop.

   for(i = 1; i <= 5; i++)
   {
    // Submit data
   }

The challenge I am encountering is with submitting 4 different values. Because the preferrable option is a list of values per User, I have created parameter files for each user, PO_{UserId}. My intention behind doing this is to make vugen pick each file and parse through the file for 4 values and submit 4 values. I have setup the option of Sequential->Per occurance for PO_{UserId} parameter file. This is not working as expected. I am reusing the csv upload concept that I had used earlier where I set value with sample_{UserId}.csv and File=yes. I understand the scenario here is different and we are not looking at using the file's contents in one go but to parse the file and submit data 4 times. I really appreciate any assistance.

  for(i = 1; i <= Count; i++)
   {
 web_submit_data("Submit_i",
    "Action=...",
    "Method=POST",
    "Referer=...",
    "Snapshot=t6.inf",
    "Mode=HTML",
    ITEMDATA,
    "Name=id", "Value={LR_MyId}", ENDITEM,
    "Name=preferable_option", "Value={PO_{UserId}}", ENDITEM,
    LAST);
  }

Viewing all articles
Browse latest Browse all 3978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>