Registering User-Defined Functions as Test Object Methods

Registering User-Defined Functions as Test Object Methods

You can also use the RegisterUserFunc statement to add new methods to test objects or to change the behavior. of an existing test object method during a run session.

Note: You can also register new user-defined functions using the QuickTest Function Definition Generator. For more information, see Using the Function Definition Generator.

When you register a function to a test object, you can define it as the default operation for that test object, if required. The default operation is displayed by default in the Operation column in the Keyword View when the test object to which it is registered is selected.

If you choose not to register a function to a test object, it becomes a global function. Global functions can be called by selecting the Functions category in the Step Generator (for function libraries), the Operation item in the Keyword View, or when using IntelliSense. You use the UnregisterUserFunc statement to disable new methods or to return existing methods to their original QuickTest behavior.

To register a method, you first define a function in an associated function library. You then enter a RegisterUserFunc statement at the end of the function that specifies the test object class, the function to use, and the method name that calls your function. You can register a new method for a test object class, or you can use an existing method name to (temporarily) override the existing functionality of the specified method.

Your registered method applies only to the function library in which you register it. In addition, QuickTest clears all function registrations at the beginning of each run session. 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16792402/viewspace-567333/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/16792402/viewspace-567333/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值