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

Answers were Sorted based on User's Feedback



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

Answer / vijay

Dim ListCount

ListCount =
Browser("Name").Page("Name").WebList("Name").GetROProperty("items
count")'Count the items in the list

ListCount = ListCount-1 'index value starts from 0

Randomize 'initiate random number

RandomValueList = Int(ListCount * Rnd)' convert
listcount as random number in the RandomValueList variable

Browser("Name").Page("Name").WebList("Name").Select
("#" & RandomValueList) 'Call the RandomValueList variable
appending to index of weblist

Is This Answer Correct ?    6 Yes 1 No

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

Answer / 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

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

Answer / kiran1783

get thetotal items in the list
and use the ' Randamize ' function Rnd()

Is This Answer Correct ?    1 Yes 4 No

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

Answer / kishore

Get the count of elements in the weblist


for i = 0 to count-1

result = randomnumber(i,count-1)


browser("xyz").page("xyz").weblist(" ") .select result

next

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More QTP Interview Questions

What is the XML file architecture ?

0 Answers  


There is a very good institute for Automation Testing using QTP.For more details please visit jbslearnings.com.

1 Answers  


How to capture a window in QTP?

0 Answers   IBM, Mphasis,


How to Install QTP on Citrix Environment? Possible send me the installation steps.. That would be great help

1 Answers  


I am using environment variable xml to give credenatials for login into unix. Is there any way we cam mask the password in the xml?

1 Answers  






What criteria do you use when determining when to automate a test or leave it manual?

2 Answers  


I had installed QTP 9.2. It is working fine but whenever I open QTP, it is trying to reinstall the below-mentioned files again and again "QTP92PS82UPGRADE.exe", "recogn.dll". If anybody has these files, please provide those files in this site or you can send that files to my mail id also (lravi4u@yahoo.com). If you don't know where the files will be in the QTP, search in the QTP software CD or path of QTP program installed (C:\Program Files\Mercury Interactive\QuickTest Professional)

0 Answers  


If u r using descriptive programming to identify the object where do u write the script for those objects? do u write it in the expertview? plz do answer its urgent thanks advance.

3 Answers  


anyone can explain about "Hybrid framework" in QTP

5 Answers  


interviwer asks what is data table? my ans is Data table is an internal Excel file of QTP...intervier not happy with this also? can u post any other answer?

3 Answers   Accenture,


How to remove the associated function library?

0 Answers  


This is the script generated by qtp plz can anyone write the same script using descriptive programming plzzzz guys do answer. Browser("orkut - login").Page("orkut - login").WebEdit ("Email").Set "rgovard" Browser("orkut - login").Page("orkut - login").WebEdit ("Passwd").SetSecure "47525d8be4926ea2f6e96b9a3f7472b6ae38" Browser("orkut - login").Page("orkut - login").WebButton ("Sign in").Click Browser("orkut - login").Page("orkut - home").Link ("Logout").Click Browser("orkut - login").Page("orkut - login").Sync Browser("orkut - login").Close

6 Answers  


Categories