Highlighted
Outstanding Contributor.
Outstanding Contributor.
845 views

TruClient: choose a random value from a search results? ...

Jump to solution

I do a search on our Web app that returns a list/table of items, each is a hyperlink. Record and playback works fine.

But how can I choose a random item to click on?

Thanks,
Chris

0 Likes
1 Solution

Accepted Solutions
Highlighted
Respected Contributor.
Respected Contributor.

Re: TruClient: choose a random value from a search results? ...

Jump to solution

You are welcome.

Set the Ordinal argument to 0 can be used for list.

In the attached file I uploaded(LoadRunner11.00_AjaxTruClient_Parameterization.pdf), there is an examaple about how to select a radio button randomly, please have a check.

View solution in original post

0 Likes
5 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Re: TruClient: choose a random value from a search results? ...

Jump to solution

Hi Chrism,

Set the Ordinal argument to 0. TruClient will automatically select a random option from the list.

For details, please check the attached files, in LoadRunner11.00_AjaxTruClient_Parameterization.pdf there is an example about how to select random element.

 

Regards,

Joe

 

 

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: TruClient: choose a random value from a search results? ...

Jump to solution

Thanks, Joe. I thought that only worked with List Boxes? I'll give it a shot.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: TruClient: choose a random value from a search results? ...

Jump to solution

Hello Speedmaster.
You can also use the Eval JavaScript from the Object Identification and modify the used XPATH as desired. You can use parameters or even Math.random function to generate a value and modify the string of the XPATH you want to use.

HP Support

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

Re: TruClient: choose a random value from a search results? ...

Jump to solution

You are welcome.

Set the Ordinal argument to 0 can be used for list.

In the attached file I uploaded(LoadRunner11.00_AjaxTruClient_Parameterization.pdf), there is an examaple about how to select a radio button randomly, please have a check.

View solution in original post

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Re: TruClient: choose a random value from a search results? ...

Jump to solution

That worked, thanks. Just switched to xpatch and changed the value.

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.