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/，如需转载，请注明出处，否则将追究法律责任。