Forum Discussion
Couple of minor notes on the code:
1) Detecting exists is best if you do the assignment using WaitAliasChild
Set updateAddWindow=mypage.WaitAliasChild('panelPnlupdate', 5000)
2) If you're actually expecting an array, you should use FindAllChildren instead of FindChild.
Now... that all said, if you want to click on a specific radio button, the For loop is not the way to do it, at least not as you have it. It will click on ALL the radio buttons.
So... what I would do.... I'm not sure how your developers set up your radio buttons but many times the radio button caption will be part of the component itself. So, I would do just a "FindChild" to look for the radio button but, instead of just looking for ObjectType alone, I'd add a second property in the find to look for the desired caption.
Dim PropArray, ValueArray PropArray = Array("ObjectType", "Caption") ValueArray = Array("RadioButton", "MyCaption") Set objRadBtn = updateAddWindow.FindChild(PropArray, ValueArray, 20)
This will allow you to find the specific desired radio button. You can replace those property/value pairs with whatever you need to find the button you're looking for and then click on that button, no for-loop needed.
Hi,
I've used your method and works fine on a static radiobutton where caption is the same, but my case that caption changes based on user input. but the position stays the same. so i was thinking i could click on the item based on their index, but don't know how to do it, say i want to click the last item, i hope you understand my issue. thanks
- tristaanogre6 years agoEsteemed Contributor
Sure. As mentioned, instead of the Caption, you can use a different property. Whatever property you want and that can include the index. It's just a matter of determining your array of properties and corresponding values of what you want.
- salley6 years agoFrequent Contributor
thanks, i don't have any static propery except the object type. idStr,objectIdentifier changes. the only solution i see is click on radio button based their index's , i just don't know how to pass the index number. Thanks
- tristaanogre6 years agoEsteemed Contributor
The index number should be a property as well.
Related Content
- 11 years agomike_zone
Recent Discussions
Check PopupMenu exists
Solved3 days agomfoster711- 4 days agosimonaferrara
- 4 days agomacheshmeh