-->Difference between Actions & Functions

Actions:
1. When we reuse an action, we get all the resources like source code, data table contents & object repository.
2. When the source action is modified, the target script will get effected incase of ‘Call to Existing’ & it will not get effected incase of ‘Call to Copy’.
3. If we have to reuse a code with out any modification along with the object repository, then we use ‘Call to Existing’. And if we want to reuse with modification, then we use ‘Call to Copy’.
4. Actions are designed by QTP.
5. Most of the time actions contain the QTP script. i.e, the GUI objects, methods & properties, etc.

Functions:
1. When we reuse a function, we can reuse only the source code & not the data table contents or object repository.
2. When the source function is modified the target script will have the impact.
3. When we want to just reuse a code without any modification, then we can go for functions.
4. Functions are designed by Microsoft as part of VB Script.
5. Most of the time functions contain the VB script code like conditional & control statements, file system objects, etc.