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
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object..
write a script to verify the image path(src property) of the images which are in web pages.
How to test background color and dynamic images during run time can you put the check point for moving objects?
I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com
How to creating an output value using quicktest professional (qtp)?
If created one virtual object? Next time I changed the window position will it work?
write a script to verify links on any web page by using descriptive method by creating a description object (give a filter condition only link) ... need to verify expected like name by reading
I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.
"What are the common constrains that we need to consider when we prepare testcases for ASP application". Thanks in Advance...
What is Associate Repository in QTP 9.2 ?
How to associate function library at a run time?
What are the different recording modes and how do they work?
How many lines of code in each script of QTP?
What are metrics and matrix?
Who uses qtp tool?