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 |
Hi This is tanya actually im facing problem in Qtp actully some time QTP doesnot recoznise the recorded object due to which script is going to fail.so can you tell me how we can handle this situation and i have another concerened issue is that at the time of run New errors comes every time so how we can handle this sitauation how we can add Recovery scenarios to the script.some time application runs successfully and some time it produces new error thats why i am facing lot of problem please give me the sugeestion as soon as possible.
4. what is the use of Text output value in Qtp?
how to invoke the web application through script in qtp
How we can add actions in the test using QTP?
How to parameterize a text field and the same field as combo field on next page. Means inserting values in Text field will appear in the combo field. for example country name, state name. Kindly reply it is urgent !!!
Give a comment on Regular Expressions using QTP?
How u perform exception handling in QTp,what is other name for ths?
How many ways return more then one value from function?
what is the process to follow between writing the test cases & then atomating it?
what is automation(qtp)bug pls giv me one ex?
How to do Laod testing for web based Application?
what r the send key commands in QTP why they r used