Highlighted
Absent Member.. Absent Member..
Absent Member..
6001 views

Dyanmic number of requests within a web_concurrent_start (end)

I'm using 11.52 patch 1 web protocol

 

I need to grab pictures of a random customer's puchases.  Some customers have zero on record purchases, some customers purchase hundreds of items.  When the browser requests these pictures, it does so in at the same time (i.e. a web concurrent request).  

 

Any tips on how I can create simulataneous requests of n number of pictures?  Obviously, I can easily correlate the pictures I'm being sent and put them into a for loop to grab every one of them but that doesn't account for concurrency.  

 

I'm hoping there's a function call I'm not aware of that makes this kind of thing nice and easy.  Otherwise, I suppose I might be able construct an eloborate web_custom_request (or series of requests), but it seems like there should be a good way to do this kind of thing.  

0 Likes
9 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

Hello

I dont really understand your goal, but yes you can do it using the function web_concurrent_start, then after this add all the calls or functions to get the pictures and then add web_concurrent_end, what ever is between web_concurrent_start and web_concurrent_end will be executed simultaneously.

 

Check on function reference for additional details.

 

hope this helps

 

regards

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

Thank you for your response.  Sorry, maybe I could've been clearer.  I'm aware of the web_concurrent_start and web_concurrent_end functions.  What I need is to have a dynamic number of calls within the that call.  

 

For example:

Customer 1 has bought four items.  

web_concurrent_start

picture 1 (item a) 

picture 2 (item b)

picture 3 (item c)

picture 4 (item d)

web_concurrent_end

--- iteration ends, new customer

Customer 2 has bought two items.  

web_concurrent_start

picture 1 (item e) 

picture 2 (item f)

web_concurrent_end

--- iteration ends, new customer

Customer 3 has bought six items.  

web_concurrent_start

picture 1 (item g) 

picture 2 (item h)

picture 3 (item i)

picture 4 (item j)

picture 5 (item k)

picture 6 (item l)

web_concurrent_end

---

 

How can I get a variable number of requests sent within a web_concurrent_start block?  

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

ok I got the idea, I would need to know more and see one script to give someting more specific but here is my idea.

Lets say there is a maximum of 10 pictures you will need, all the uses will purchase 10 articles or less, so you create inside the web_concurrent block the 10 requests for getting 10 pictures, each request will evaluate using a If statement if there is need for that picture or not, since you know how many itemd each user got you simply parametize that part, in example, user AAAA purchased 7 items, so you paramtetrize the user name and the 10 picture names, but the last 3 pictures will be called 0000.jpg in the parameter value, so the if will evaluate if the name is or not 0000.jpg before execute the statement to call the picture, not sure if you get the idea.

 

maybe if you share more details about the info you will have in advance, and how the function that call those pictures looks like and the picture name format or something that helps to understand better how far we can get using custom code.

 

 

regards

Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

Thank you for the response.  I was thinking of the same approach but there can be hundreds of pictures or zero pictures, so I'd have to create hundreds of (usually unused) web requests to accomodate this kind of thing.  The programmer in me sees this kind of approach as less than great, but I suppose I'll have to deal with it.  

 

I'll give this some more thought and research and post here if I come up with a good solution.  

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

Can you please share one or two functions for calling those pictures, I would like to try to find out a recursive code for doing this.

regards
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

It's just a simple web_url call

 

     web_url("womens.jpg"
        "URL=http://<hostname>/womens.jpg"
        "TargetFrame="
        "Resource=1"
        "RecContentType=image/jpeg"
        "Referer=http://<hostname>/Search.html"
        "Snapshot=t93.inf"
        LAST);

    web_url("pants.jpg"
        "URL=http://<hostname>/images/pants.jpg"
        "TargetFrame="
        "Resource=1"
        "RecContentType=image/jpeg"
        "Referer=http://<hostname>/Search.html"
        "Snapshot=t94.inf"
        LAST);

    web_url("6487221274360_180x240.jpg"
        "URL=http://<hostname>/<webservice>/6487221274360_180x240.jpg"
        "TargetFrame="
        "Resource=1"
        "RecContentType=image/jpeg"
        "Referer=http://{server}/Search.html"
        "Snapshot=t95.inf"
        LAST);

0 Likes
Highlighted
Established Member..
Established Member..

Re: Dyanmic number of requests within a web_concurrent_start (end)

HI,

 

Did anyone tried to script the dynamic web concurrent request in a good mannner? We've same issue and need some help ASAP

 

Thanks

0 Likes
Highlighted
Contributor.
Contributor.

Re: Dyanmic number of requests within a web_concurrent_start (end)

Hi,

Having the same problem. If anyone was successfully able to resolve this, please update.  Although I am using a different tool, but I was wondering if Loadrunner has an easier and feasible way of getting this done. 

 - Sameer

0 Likes
Highlighted
Respected Contributor.
Respected Contributor.

Re: Dyanmic number of requests within a web_concurrent_start (end)

My 2 cents:

There will be Count of total requests for implementing this, use that count and then write the Script as suggested by Micro Focus Expert;

Do you have the option to use Web Truclient Protocol? if you trying to Record the Entire page load with your images? 

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.