QTP 中3种加载函数库的方法和动态调用方法

来源:互联网 发布:elementary os知乎 编辑:程序博客网 时间:2024/05/29 04:45

 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 提供了两种动态调用函数的方法。

ExecuteGetRef 方法

 

Option ExplicitDim new_helloworld Function helloworld            MsgBox "hello shit"End Function Set new_helloworld =GetRef("helloworld") Call new_helloworld execute "Call "& "helloworld"


原创粉丝点击