QTP 中3种加载函数库的方法和动态调用方法。
封装这个大家都喜欢,它带来了简洁,复用。
QTP 提供了3 中动态加载函数库的方法。
2中动态的,一种静态的。
动态方法1
Excutefile “D:\test\function.vbs”
只
动态方法2
LoadFunctionLibrary “D:\test\function.vbs”
支持vbs、txt、qfl格式
静态方法1
在QTP -> File -> Resource 添加自己的vbs 文件
静态方也 支持vbs、txt、qfl格式
Vbs 提供了两种动态调用函数的方法。
Execute 和 GetRef 方法
Option Explicit
Dim new_helloworld
Function helloworld
MsgBox "hello shit"
End Function
Set new_helloworld =GetRef("helloworld")
Call new_helloworld
execute "Call "& "helloworld"