Difference between action and function

Questions by kusuma123

Showing Answers 1 - 9 of 9 Answers

Debashish Samanta

  • Dec 5th, 2006
 

Action:

Action is a collection of Vb statements in QTP.

It doesnt return any values.

Function:

Function collection of Vb statements in QTP.

It returns single value.

  Was this answer useful?  Yes

anjalireddy

  • Jan 2nd, 2007
 

  • 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.



  Was this answer useful?  Yes

kumaran_elan

  • Jun 15th, 2007
 

Every Action will have its own Datatable where as function does not. And the call to the actions can be set in the Action Iteration which is not possible in a function.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions