Forum Discussion
Thank everyone for the updates .
The reason why I am trying to go create generic functions because we have 300-400 web applications that will be automated in the future. If I create generic functions and passing Name Mapping as parameters then we have to create less functions whenever we work for automation for new application.
I am trying to create generic function for radio button. We are using java script .
Let me know if additional details . Attached the screenshot.
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.
- nisgupta7 years agoValued Contributor
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");
}
}
}
Related Content
- 4 years agoAutomation1id
- 11 years agojose_pita
Recent Discussions
- 2 hours agoashly