开发者

Can I reference one function library from another within QTP

I want t开发者_Python百科o reference a function from one Function Library in another in QTP.

This is programming basics but reading QTP help, it looks like everything has to be accessed through the 'Test' layer which means that writing utility functions such as date handlers.


  1. You can indeed write functions in action scripts. You do not have to write function libraries to write and use custom functions. For reusability, function libraries make sense.

  2. You can put as many functions into one function library as you wish.

  3. Should you want to create more than one function library, you simply add them all to the resources settings of each test.

  4. If function libraries depend on each other, you should make sure to reference them in the correct order in the test settings.

  5. There is an ExecuteGlobal statement in VBScript which would allow you to specify a (huge) string containing function definitions. Executing ExecuteGlobal with such a string would declare all those functions. This is (besides ExecuteGlobal's sister functions, like ExecuteFile (or what was it called?)) the only real alternative to using function libraries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜