Highlighted
Absent Member.
Absent Member.
1593 views

How to select first hyperlink in Vugen Script

Jump to solution
Hi Groups


I have scenario like this and i am facing some issues.
VU Gen script which click on random link every time the VU Gen script is executed, for example take google and enter some text
click on first result and next time when we run the script it should
enter different value in the search box and should click on search button and then click on 1st hyperlink.

Can you guys suggest me the approching steps for clicking on the first hyperlink.I have tried to find server response but it doesnot work.Is there is any specfic function avilable in Loadrunner.



Thanks
Abhidip
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.
Hi Abhidip

what you need to do is find the link by using web_reg_save_param function (read help file for more info).

After you find the URL Link that you are trying to click from the function above. You then web_url function to submit your link (sort of like clicking on the link.)

Chen

View solution in original post

5 Replies
Highlighted
Absent Member.
Absent Member.
Hi Abhidip

what you need to do is find the link by using web_reg_save_param function (read help file for more info).

After you find the URL Link that you are trying to click from the function above. You then web_url function to submit your link (sort of like clicking on the link.)

Chen

View solution in original post

Highlighted
Absent Member.
Absent Member.
lr_paramarr_random can be used to pick the random value from a parameter array.
0 Likes
Highlighted
Absent Member.
Absent Member.
Not come across lr_param_random before. Are you sure it is part of the default installation and not a custom fucntion added by someone.

Sounds like web_reg_save_param is the way to go and you will need to have either ORD=1 if you are just interested in the first link.
Highlighted
Absent Member.. Absent Member..
Absent Member..
Hi Abhidip,

Did you get a resolution to this one? Please let me know. I'm facing a similar problem.
0 Likes
Highlighted
Established Member..
Established Member..
Hi Abhidip,

You need to place a dynamic value capture correlation code just before the request in which your dynamic values gets generated. Then selection depends up to you, which you can diverge with ORD.

In Google example say you enter search criteria to search engine, to retrieve the search results you hit the search button and the list of search result will get displayed. Now you need to select one of the search links.

So here you can put your web_reg_save_param just before you hit Search button and vary the ORD. Say if you put ORD = 1 it will select very first link.

I hope you got what I am trying to explain.

Good Luck....

Thanks
Ajay
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.