INTERVIEW Q&A

1)      What is the difference between function and action in qtp
a)Action is internal to QTP whereas functions are generic and are coded    in VBscript. The main difference between an action and a function is that "an actions contains an Object repository." An action can also be shared; it can also use different shared reposiroties. A function on the other hand doesn't have an object repository and is just merely a code that returns some desired value(s).
  • b) Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository
    associated with it while a function can't. A function is just lines of code with some/none parameters and a single return value while an action can
    have more than one output parameters.
Where to use function or action:
Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any

automation script i.e. a function like getting a string between to specific characters now this is something not specific to QTP and can be done on

pure VB Script so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of

using function/action depends on what any one would be comfortable using in a given situation.

2)     What is the difference between Call to Action and Copy Action.?

When you insert call to existing action then it is read only mode . It is external action we cannot modified the action
Copy action: When we can insert call to copy action then we can modified the action. It just copy the action,when we modified the action the orginal action will not change, it change copy action only

No comments:

Post a Comment