I have multiple radio buttons i need to select a radio
buton and i dont want to hard code i have a generic
function for it there i have used select#0 so it selects
first radio button but for other script i want to select
the 4th radio button how i can make it still more generic
Answer Posted / menaka
count the radiobutton in the appliation and u can select
the last radio button or the u can select radiobutton
randomly.
here is the code..
Set desc=description.Create()
desc("micclass").value="WebRadioGroup"
Set radio=Browser("...").Page("..").ChildObjects(desc)
radiocount=radio.count
msgbox radiocount
For i=o to radiocount-1
itemcount=radio.item(i).GetRoProperty("items count")
msgbox "item count:" & itemcount
Next
'FOR SELECTING THE LAST RADIO BUTTON
variable1="#" & itemcount-1
'so use the variable1 wherever u want to select the item.
'RADOM SELECTION OF RADIO BUTTON
variable2=RandomNumber(0,(itemcount-1))
randselection="#" & variable2
'use variable2 where ever u want to select the radiobutton
randomly.
| Is This Answer Correct ? | 26 Yes | 4 No |
Post New Answer View All Answers
What the differences are and best practical application of Object Repository?
Why is Client side image is preferred over server side image?
i have asked earlier only one question how to test web application using QTp plz send me the answer quickly
What does mean by Scope of Automation?n How we defined it?
How does you pass optional arguments in qtp?
How you can delete excel file in qtp?
What is the parameterization?
Where is the resultset of a sqlquery (which is fired by rsobj.open sqlquery,xxxx,xxxx) stored ?
write the vb script for call to new action in qtp?
Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
How to test fly out menu in qtp?
What is TOM in QTP?
Is it possible to use two instances of UFT on the same machine? If not why?
How to save your test using quicktest professional (qtp)?
1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?