Difference between Action and Function

本文详细解析了QTP环境中Action与Function的概念、调用方式、保存格式、内部特性、可重用性及参数处理等方面的差异,帮助开发者更好地理解和运用这两种基本元素。

Difference between Action and Function?

♦  Action is a collection of Vb statements in QTP. It does not return any values.Function collection of Vb statements in QTP.
    It returns single value.

♦  We can call functions within actions but we can't call actions within functions

♦  Generally functions are saved with ".vbs" extention where as actions will save with ".mts".

♦  Every Action will have its own Datatable where as function does not.

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

♦  Action can contains Object Repository, Data table, Active screen etc. whereas function do not have these features.

♦  Action is internal to QTP whereas Function is just lines of code with some/none parameters and a single return value.

♦  Action can/can not be resuable whereas functions are always reusable.

♦  Action Parameter have default values whereas VB script function do not have any default values.

♦  Action parameter type are byvalue only where vbscript functions can be passed byref.

♦  Action can have multiple output(returning) values whereas function can return only single value

_______________________________________________________

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值