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
Can QTP be used for GUI testing ?, We are using Java with MySQL and Operating system is Linux. We are NOT using the web.
what is profile tool?
i have doubt suppose iam purly working in manual, when i will get work to do on sql and performence testing? pls any one clarify doubt?
Define Environment Variable in UFT and its uses?
can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?
What are the ordinal identifiers in web page?
how we connect 1. qtp9.2 to the quality center9.0? 2. Load runner8.0 to the quality center9.0
what r the verstions from 1st to present (verstions) of mercury tools (like winrunner,QTP,Loadrunner) ? Chandana
Tell me one scenario, the complex functionality you have automated in your project?
what is the diffrence bw qtp architectute and qtp framework?
What do you to script when objects are removed from application?
explain structured testing? plz guys with exp. do answer
How to do the scripting. Is there any inbuilt functions in qtp as in qtp-s.
whare exactly we have to use functions and sub routain
They asked by using qtp recording writing scripting