how can you select random value for every iteration from a
weblist

Answer Posted / amarendra kothuru

First get the Items count from the List and Use the
RandomNumber() function to get the random Index value. The
below code will work

ItemsCount = Browser("Browsername").Page("PageTile").WebList
("WebListName").GetROProperty("items count")
Browser("Browsername").Page("PageTile").WebList
("WebListName").Select ("#" & RandomNumber(0,ItemsCount))

Is This Answer Correct ?    7 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do you parameterize search button from the website? the page is a single winobject and i have made a virtual object button of search button but search box can't be converted into a winedit and if we try to convert it into winedit the value we enter in a searchbox appears as numbers in the script so we arent able to parameterize.help!!!

1728


What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?

692


Where to use Property Let, Property Get, Property Set in UFT

368


How to check which add-ins are associated with a test in qtp?

579


What is the syntax to call one action in another?

548






Can U Explain about QTP tool from older version to latest version also its differences?

1512


A FORM CONTAINS 5 FIELDS. 1 FIELD IS ENABLED REMAINING(4) FIELDS DISABLED. MY QUESTION IS ENTER VALUES INTO 1 FIELD AFTER THAT CLICK TAB BUTTON THEN 2 FIELD ENABLE THIS PROCESS CONTINUE UPTO 5TH FIELD. HOW TO WRITE CODE IN DESCRIPTIVE PROGRAMMING. PLZ TELL ME THE PROCEDURE AND CODE FOR IT.

1270


can u explain the keyword driven framework with an example clearly how to create all the files and how to attach to main test.

5092


• What type of testing questions will be asked for 2+ yrs exp people in interview?

1250


Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..

1512


Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?

1509


How many types of run modes are there in qtp?

584


how to convert 100 into hundred repees only and viceversa

1445


Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this

2059


Tell me one scenario, the complex functionality you have automated in your project?

1471