Forum Discussion
Hi,
You can create generic function to click the Radio button and it will have only the Click operation.
But in-order to know which Radio needs to be clicked, you need to have function to identify that.
ForEx:
In your attached screenshot, if you want to click the second radio button how will find it. If you know how to find it then you create common functions to do that.
In my case I have tried to implement generic function to determine which radio button need to be clicked but it is not working . Besides I don't see any testcomplete methods for radio buttons just like we have for drop down values . We want to select the radio button based on the R# value.
Please advise
Thanks
Nishchal
- tristaanogre7 years agoEsteemed Contributor
Couple of things:
1) Can you post the code that you are using for your radio button generic?2) Can you post screenshots from your object browser showing
a) The parent object containing the radio buttons and its properties
b) At least one radio button object and its properties.
This will help us help you in correcting your generic.
- nisgupta7 years agoValued Contributor
here is the below code.
function SelectRadioButton(RadioButtonObj,RadioButtonValue){
var selectRadioButtonValueSuccess = false;
if(RadioButtonObj.WaitForProperty("Enabled", true,3000))
{
var radiobuttons = RadioButtonObj.wItemCount;
for(i=0; i<radiobuttons; i++){
if(radiobuttons.wItem(i) == RadioButonValue)
{
RadioButtonObj.Click();
selectRadioButtonValueSuccess = true;
break;
}
}
if(selectRadioButtonValueSuccess == false)
{
Log.Error("No Radio Button Values are found");
}
}
}- nisgupta7 years agoValued Contributor
Attached are the 2 folders
radiobutton_parent.zip
radiobuttonObjects.zip
Let me know if you need more details
Thanks
NG
Related Content
- 4 years agoAutomation1id
- 11 years agojose_pita
Recent Discussions
- 6 hours agoSvetaG