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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ashish
hi, What you can do is
Create a function which accepts a parameter (Index #).
Pass the index number to the radio button u need to click.
| Is This Answer Correct ? | 35 Yes | 14 No |
Answer / saisree
Hi
i tried to solve my problem but i didn't get how to do. can you please help me.
I have one web application in that when you are going to click webedit that will generate one window in that so many radio buttons are there i have click one radio button but all the properties are same for all radio buttons and index is not there and i have to select randomly i tried above code also its not working. please help me
My code:
With browser("title:=Hospital Management System")
With .page("title:=Hospital Management System")
.link("name:=Transactions","x:=-11215").Click
.link("name:=Purchase Invoice","x:=-23040").Click
.webedit("name:=supcode").Click
Dim variable2
Set desc=description.Create()
desc("micclass").value="WebRadioGroup"
Set radio=.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
variable2=RandomNumber(0,(itemcount-1))
randselection="#" & variable2
Mesgbox showing "0" radio buttons in page
End with
End with
| Is This Answer Correct ? | 0 Yes | 0 No |
write a vb script to print even numbers from 1-50?
6 Answers Kclink Technologies, Logica CMG,
how do u handle an object with out name in our application using QTP 9.2?
What is the Difference between test object and run time object?
1. Pls can anyone give me the descriptive programing script to find the number of edit boxes in a login window in flights reservation (windows application only not web). 2. Using descriptive programing, how do you handle changing URLs. Pls anyone, very urgent
How can i open 5 multiple browser at once through QTP VB script
when do we write a script in qtp?(plz give me more then 2 reasons)
hi i have one issue while selecting weblist i want show one particalur item in weblist .ex one weblist they are monday to sunday i want show the reporter like thurday in particular weblist can you help me about this thanks balaji
When should I use smart identification?
how can we retrieve ten rows from the data table using loop concept?
How can we encrypt the username using recording mode in login window? There is 2 encrypted types what are it
Among the 3 Recoring modes,Standard, Analog and Low Level. which one is mostly used. I know that Analog id used for Graphs, Digital Signatures and Barcoding. so, which one among the 2?
It is a SQL question. Write a query to find top three salaries in an EMP TABLE?