Forum Discussion
Based on your code what i understand, you want to have some generic functions which can perform actions like ClickButton, Select Dropdown, etc.
Yes, this kind of functions would be useful when you want to have a framework for Object actions.
In some scenarios, It won't be helpful if you trying to do different operations with Textbox.
As tristaanogre, AlexKaras said, If it is useful for your AUT structure and business needs then it is good have.
I have similar kind of function that i wrote for Setting up of Text,
function EnterText(objMainObject,strValue,strFridenlyName) { //objMainObject should be Text box object if(objMainObject != null) { if((objMainObject.Exists) && (objMainObject.Visible)) { if(aqConvert.VarToStr(strValue) == "null") { objMainObject.Keys("^a"); objMainObject.Keys("[BS]"); } else if(aqConvert.VarToStr(strValue) != "") { if(aqString.Compare(aqConvert.VarToStr(objMainObject.getText()),strValue,true) != 0) { objMainObject.Keys(strValue); if(aqString.Compare(aqConvert.VarToStr(objMainObject.getText()),strValue,true) == 0) { Log.Event(strFridenlyName + " object is entered as " + strValue); } else { Log.Error(strFridenlyName + " object is not entered as " + strValue); } } else { Log.Event(strFridenlyName + " object is already as " + strValue); break; } } else { Log.Message("No value found for input"); } } } }
- nisgupta7 years agoValued Contributor
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.
- shankar_r7 years agoCommunity Hero
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
Related Content
- 11 years agojose_pita
- 4 years agoAutomation1id
Recent Discussions
- 13 hours agovladd1