04-05-2011, 01:53 PM
(This post was last modified: 04-05-2011, 01:55 PM by michiusa69.)
A little bit more explanation ... Here is the Webtable with onw RadioButton Group:
First Run
1,1 -> WebradioButton #0
1,2 -> WebradioButton #1
2,1 -> WebradioButton #2
2,2 -> WebradioButton #3
Secon Run
1,1 -> WebradioButton #0
1,2 -> NO RadioButton
2,1 -> WebradioButton #1
2,2 -> WebradioButton #2
-> see that the index changed? Last button is now #2 and not #3
Third Run
1,1 -> WebradioButton #0
1,2 -> NO RadioButton
2,1 -> WebradioButton #1
2,2 -> WebradioButton #2
3,1 -> WebradioButton #3
3,2 -> NO RadioButton
-> In this example, we got a new colum ...
So what I want to do is this: Dear QTP - please go to column X and row Y and select the correct (!) radiobutton by looking as its index
I also found this code, but again you have to set the <index> which I don't know before running the test ...
First Run
1,1 -> WebradioButton #0
1,2 -> WebradioButton #1
2,1 -> WebradioButton #2
2,2 -> WebradioButton #3
Secon Run
1,1 -> WebradioButton #0
1,2 -> NO RadioButton
2,1 -> WebradioButton #1
2,2 -> WebradioButton #2
-> see that the index changed? Last button is now #2 and not #3
Third Run
1,1 -> WebradioButton #0
1,2 -> NO RadioButton
2,1 -> WebradioButton #1
2,2 -> WebradioButton #2
3,1 -> WebradioButton #3
3,2 -> NO RadioButton
-> In this example, we got a new colum ...
So what I want to do is this: Dear QTP - please go to column X and row Y and select the correct (!) radiobutton by looking as its index
I also found this code, but again you have to set the <index> which I don't know before running the test ...
Code:
set WebRadioGroupname=Browser("Browsername").Page("Pagename").WebTable("Tablename").ChildItem(<RowCount><Column Count>,"WebRadioGroup",<Index>)
ab= WebRadioGroupname.GetRoProperty("name")
Browser("Browsername").Page("Pagename").WebRadioGroup("RadioGrpLogicalNameFromObjectRepo").SetTOProperty "name",ab
Browser("Browsername").Page("Pagename").WebRadioGroup("RadioGrpLogicalNameFromObjectRepo").Select "#0"