您的位置:首页 > 编程语言 > Qt开发

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

2012-06-14 16:23 302 查看
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 Explicit
Dim new_helloworld

Function helloworld
MsgBox "hello shit"
End Function

Set new_helloworld =GetRef("helloworld")

Call new_helloworld

execute "Call "& "helloworld"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: