Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - What is the difference between action and function?




285
views
asked marvit August 18, 2014 11:48 PM  

What is the difference between action and function?


           

1 Answers



 
answered By Dharma   0  
  1. Action is a collection of Vb statements in QTP. It does not return any values.Function collection of Vb statements in QTP.
  2.     It returns single value.
  3. We can call functions within actions but we can't call actions within functions
  4. Generally functions are saved with ".vbs" extention where as actions will save with ".mts".
  5.  Every Action will have its own Datatable where as function does not.
  6.  Action can have a object repository associated with it while a function can't. A function is just lines of code with
  7.     some/none parameters and a single return value while an action can have more than one output parameters.
  8.  Action can contains Object Repository, Data table, Active screen etc. whereas function do not have these features.
  9.  Action is internal to QTP whereas Function is just lines of code with some/none parameters and a single return value.
  10. Action can/can not be resuable whereas functions are always reusable.
  11. Action Parameter have default values whereas VB script function do not have any default values.
  12. Action parameter type are byvalue only where vbscript functions can be passed byref.
  13. Action can have multiple output(returning) values whereas function can return only single value.
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert