简体   繁体   English

如何将一个函数库函数调用到另一个函数库?

[英]How to call one function library functions to another function library?

I'm facing an issue where I want to use one function library function into another function library.我面临一个问题,我想将一个函数库函数用于另一个函数库。 I'm using HP UFT Tool.我正在使用 HP UFT 工具。

Funtion Library1:函数库1:

Function addition()
End Function

Function Library 2:函数库2:

Function sub()
  Call addition()
End Function

Both libraries have to be loaded using LoadFunctionLibrary or , both libraries have to be attached to the resources tab.两个库都必须使用 LoadFunctionLibrary 加载,或者,两个库都必须附加到资源选项卡。 Refer this link参考这个链接

To execute your 'sub' function, there are other ways to call it, bu the easiest is call this in the driver script.要执行“sub”函数,还有其他方法可以调用它,但最简单的方法是在驱动程序脚本中调用它。 It will automatically call the 'addition' function.它会自动调用“加法”函数。

Call sub() '' in turn calls addition function

I was also having this issue.我也遇到了这个问题。 The error (unfortunately) referred to the wrong Function file (because UFT is so wonderful), but the error was a "Type mismatch: ''"错误(不幸的是)引用了错误的函数文件(因为 UFT 太棒了),但错误是“类型不匹配:''”

This happened because the Function in Library "A" was calling a Function in Library "B" but did not know about "B".发生这种情况是因为库“A”中的函数正在调用库“B”中的函数但不知道“B”。 I added a line LoadFunctionLibrary "B.qfl" above the call and the error was resolved.我在调用上方添加了一行 LoadFunctionLibrary "B.qfl" 并解决了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM