Monday, May 10, 2010

Action v/s Function

When developing an automation framework everyone thinks whether they should go for Action based Framework or Function based Framework.

Both of them has their own Pros/Cons. But Function based framework is more robust and flexible and easily maintainable. Depending on the Licensing feasibility and Resource skill set either one can decide Functions or Actions.

Major Differences
Actions
1.Actions are part of Quick Test Professional
2.Actions has their own object Repositories and Data sheets. Handling Object Repositories and Data Sheets are much easier.
3.Parameters to an Action can be passed through only Input parameters and these parameters have to declared in the Action settings.
4.Action always return Boolean. If any custom value needs to be returned then it has to be returned as Output parameter which is again part of Action Setting
5.Well Integrated with QTP. It occupies much more memory compare to Functions
6.Cannot pass the value By Ref or By Val.
7.QTP Intellisense is available
8.QTP Editor is required to write the code.

Functions
1.Purely part of VBScripting
2.No Object Repository or Data Sheets are available
3.Parameters can be passed as Byval or ByRef
4.Only one variable can be returned.
5.Independent to QTP
6.Occupies Less memory intern increases the performance of the Execution
7.Need to be associated with QTP
8.Scripting would be slow as QTP Intellisense is not available
9.QTP License is not required as we can use simple NotePad as an Editor

No comments:

Post a Comment