how can you select random value for every iteration from a
weblist
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / kiran1783
get thetotal items in the list
and use the ' Randamize ' function Rnd()
| Is This Answer Correct ? | 1 Yes | 4 No |
For example you are checking bit map check point before coming to the results. How can you say it is passed? Or failed? Anyways?
what is automation(qtp)bug pls giv me one ex?
A web Page has 2 frames. Find out the number of weblist items in the second frame of the page.
What is diffrence between Global variables and Environment variables...Anybody can give me answer..Thanks in advance..
1>How to get the browser name by writing the VBScript. 2>How did you used the GetROProperty and GetTOproperty .give real time scenario. 2>Give and real time ex for the bug having "High Severity and low priority"on banking doamin web based application.
On a web application I want to select list item 5 from a dropdown list. but QTP identifying this object as winobject. Then how can we select list item 5 from that dropdown list.
I have a web table,in that web table in 3rd row 4th coloumn i have a link how to click it with descriptive programming? I have a webedit without entering any value how to calculate the size of that field? I have a DB table , how to find the 5th highest salary? write query.
how to load vbs file to qtp through scripting. plz provide the code.....
Does QTP record on Objects created on XWindows Environment?
what is the Exact Meaning of Environment Variables?
What are the Features & Benefits of Quick Test Pro (QTP 8.0)?
why we are using environment variables instead of global variables?