Quantcast
Channel: All LoadRunner Practitioners Forum posts
Viewing all articles
Browse latest Browse all 12134

Re: LR TruClient Selecting a Random Radio Button

$
0
0

Selecting a random link is essentially the same as selecting a random radio button.  

 

1.  Determine the xpath of the objects in question

example:  

 /html/body/blockquote/form/center/table/tbody/tr[2]/td[1]/input

 /html/body/blockquote/form/center/table/tbody/tr[3]/td[1]/input

 /html/body/blockquote/form/center/table/tbody/tr[4]/td[1]/input

/html/body/blockquote/form/center/table/tbody/tr[5]/td[1]/input

 

2.  Determine the part of the xpath that needs to be randomized

in this case:  tr[2]

 

3. Change the selection method to evaluate xpath

 

4. Randomize a variable

write the code to select a random object

 

var options;

options = (Math.floor(Math.random9- *5)2);     where 5 is the max and 2 is the min

 

 

5. Put the randomized variable into the xpath

 

evalXPath("/html/body/blockquote/form/center/table/tbody/tr["+options.valueOf()+"]/td[1]/input


Viewing all articles
Browse latest Browse all 12134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>