LoadRunner Practitioners Forum

Can an IF \ THEN be used in a VuGen Script?

New Member.

Can an IF \ THEN be used in a VuGen Script?

Does anyone know of a way to incorporate an If\Then statement into a VuGen script?


What I have is a HTTP script that records a person hitting our website then clicking on the Browse by Category link.  Now, for the Select Category I have parameterized the categories in a file, selecting a random URL each occurrence. What I need the IF \ THEN to be able to do is read what parameter was used during that occurrence and then based on the selection, pull an item from a different parameter list.


for example if during iteration 1 CPUs was selected as the category, then during the next action where an item is placed in the cart, I want the item number (also a parameter) to be pulled from the CPUItemList parameter file. Second iteration, let's say Education was used from the Category parameter list, so during the Add Item action, the item number should be pulled from the EduItemList parameter file, etc.


Can this be done, if so, any help would be greatly appreciated.

Thank You

Micro Focus Expert

Re: Can an IF \ THEN be used in a VuGen Script?

Vugen script accepts code in C, so you can make ifs, fors, whiles, etc. Use F1 and you can see what functions you can use.



Mario M.

HP LR/PC Support

If you are customer you can try posting on our internal forums for more personalized support.


Performance Center:

How to:

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.