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 |
In qtp is it possible to check broken links of a page?
What is the need and applications of learning VB script for a automation(QTP) engineer ain Realtime ?
setroproperty and getroproperty difference
describe some problem that u had with automation testing tool?
Can we call qtp test from another test using scripting. Suppose there are 4 tests and I want to call these tests in a main script. Is this possible in qtp?
Plz someone tell me about user interface testing and backend testing and hw did u use it in ur project.plz give a detail answer i need to explain it to the interviewer. plzzzzzzzzz guys its urgent
What is difference between Recording time object identification and Run time (Execution) time.
Can anyone tell me about "Step- By Step Paramterization". among the two paramaterizations, Step by step and Parameterize All, which one is mostly used.
How to make Non reusable actions into reusable action? is that feature available in QTP
what is the silent mode in WR?
How do know the number of browsers opened?
hai there..this is chandu..i have a txt file which containing 1000 lines but at a time i want to retrieve 50 lines..after 50 lines i required to retrieve 51-100..like that i want...so could anybody help me in this...thanks in Advance..