'How to write Web_custom_request() function in loadrunner

I know the functionality of web_custom_request(). It will handle dynamic itemdata. But I don't know how to write manually in our script. Some one please help me on this.

thanks in advance...



Solution 1:[1]

Record a second script with the web_custom_request() for the item you are seeking to reproduce.

Replace the one call in your master script with the web_custom_request(). In general the variable nature of the web_custom_request() comes after the URL call and the "?" where the name|value pair parameters come into play. Here is where your foundation skills in the language of your performance testing tool come into play.

You will need to build a string which likely includes a substantial number of name|value pairs which are dynamically produced, and therefore correlated, from previous requests. You may be adding to this just a couple of elements of end user input depending upon the definition of the web_custom_request().

You are likely to need a looping structure to complement a buffer to hold your string as you are building it, appending one named value pair structure to the base string until you have your complete structure built. You can then append this to the URI as a whole and replace the literal string in your web_custom_request() for the URI and it's prameters with the one you have built to hold all of the variable dynamic components.

Embrace the code. This is why you have a full C language environment available to you.

Solution 2:[2]

when ever u want to generate custom request manually go to insert tab click on new step it will display add step dialog there select custom request and givethe details what ever it ask

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 James Pulley
Solution 2 sivaramaraju