Functions
and Actions With Examples, What is the difference between functions
and actions in QTP
What is
the difference between functions and actions in QTP?
Actions:
Yes actions have their own Data Table and Object Repository.
Generally Actions helps us to increase reusability and To test
modular. For a simple example -: If we divide our script into actions
only based on logical functionality or example like Log out, Log in
etc.
Functions:-
Yes functions are the programming concept of VB script and they never
have their own data table or object repository. Functions always help
to reuse of our code. For a simple example:- Like if you have create
a function to concatenate of two strings or numerical then once it
developed you can use is any where in script without writing a code
again and again.
Difference
between Action and Function?
- Actions are the collections of VB statement in QTP. They never return any type of value. And Functions are the collections of VB statement in QTP, These can return the required value.
- You can call the functions from the action but you can not call the action from the function.
- Function commonly stored with “.vbs” extension other hand action will store with the extension of “.mts”.
- Action always require database and they have their database But Functions don't require database.
- Actions can have associated object repository with itself but Functions don't or can not have. Actually functions are the just code of some lines with some parameters and they reqturn value only but actions generally can have more than single output parameters.
- Actions can contain data table, Active Screen, object repository etc but function don't can have these type of feature.
- Actions can or can not be re-use but functions can re-use always.
- Actions parameters have always default values but VB scripts functions never have any default value.
- Actions parameters types are by value only but VB Script function can be passed byref only.
- Action can have multiple output (Return Value) but function can definitely return single value only.
Functions and Actions With Examples
Virtual Objects with Example in QTP Cross Platform Testing
What is Object Spy in QTP Ordinal Identifiers Alone can Make an Object Unique
No comments:
Post a Comment