Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Difference between Actions and Functions in QTP/UFT 11.5


Comparison between Action and functions in QTP/ UFT 11.5 is explained in this article. We discuss on how action and functions are similar and difference between two in UFT 11.5/ QTP



Parameter
Action
Functions
Feature Type
Action is a feature provided by QTP/UFT
Function is a feature of VBScript
Return Value
We can pass as well as return multiple values using input and output parameters
A function returns a single value although values of multiple variable can be passed using public variable with global scope
Assets
An Action has local repositories, datatable, Active screen etc  associated with it
Function cannot have local repositories, datatable  and other QTP features associated with it
Multiple function can be created in an action
Multiple Actions cannot be created in a function.
Size and Performance
Size of the test increases with increase in number of actions as there is data table, OR associated with each of the test.
Performance of using function is better compared to action and consumes less size.
Actions
An Action is associated with a single test
Function library can be associated with multiple tests and can be loaded at runtime.
Maximum Allowed
There can be maximum 120 actions in a test and If any test has 120 actions in it, it will definitely not a good test script
There is no limit of number of function used in a test.
Maintenance Cost
Maintenance cost is higher in case of Action, as we need to open each test to make change at action. While multiple function library being vbs files can be updated easily.
Similarity between the Two
The purpose of using Actions or function is to provide modularity to the test scripts and should be used to create structured tests.
Extension
Extension of action script is .mts while function library can have extension as .vbs, .qfl.



No comments:

Post a Comment