QTP对象库管理 - 动态绑定对象库文件
来源:互联网 发布:奥斯卡级核潜艇知乎 编辑:程序博客网 时间:2024/05/17 08:43
QTP对象库管理 - 动态绑定对象库文件:
TestOR.vbs:
'************************************************************************************************************************
'Description:
'
'This example opens a test, configures an action's object repositories collection
'and saves the test.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtRepositories 'As QuickTest.ObjectRepositories ' Declare an action's object repositories collection variable
Dim lngPosition
' Open QuickTest
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible
' Open a test and get the "Login" action's object repositories collection
qtApp.Open "C:\Documents and Settings\allen\桌面\TestOR", False, False ' Open a test
Set qtRepositories = qtApp.Test.Actions("Action2").ObjectRepositories ' Get the object repositories collection object of the "Action2" action
' Add NewOR.tsr if it's not already in the collection
If qtRepositories.Find("C:\Documents and Settings\allen\桌面\TestOR\OR\NewOR.tsr") = -1 Then ' If the repository cannot be found in the collection
qtRepositories.Add "C:\Documents and Settings\allen\桌面\TestOR\OR\NewOR.tsr", 1 ' Add the repository to the collection
End If
' If Debug.tsr is in the collection - remove it
lngPosition = qtRepositories.Find("C:\Debug.tsr") ' Try finding the Debug.tsr object repository
If lngPosition <> -1 Then ' If the object repository was found in the collection
qtRepositories.Remove lngPosition ' Remove it
End If
' Set the new object repository configuration as the default for all new actions
qtRepositories.SetAsDefault ' Set object repositories associated with the "Action2" action as the default for all new actions
Set qtTest = qtApp.Test
qtTest.Run
'Save the test and close QuickTest
qtApp.Test.Save ' Save the test
qtApp.Quit ' Quit QuickTest
Set qtRepositories = Nothing ' Release the action's shared repositories collection
Set qtApp = Nothing ' Release the Application object
- QTP对象库管理 - 动态绑定对象库文件
- QTP对象库管理
- 用ObjectRepositoryUtil动态加载和解析QTP对象库文件
- QTP对象库管理和编写脚本
- QTP对象库管理和编写脚本
- QTP对象库管理和编写脚本
- QTP对象库
- QTP对象库学习
- QTP 学习 - 对象库
- QTP对象库
- QTP运行时,动态加载外部共享对象库
- 在QTP中如何管理对象库(转)
- QTP对象库文件转换为XML文件格式
- QTP中对象库的提取
- QTP中设置共享对象库
- QTP 共享对象库 Repository Parameter
- QTP对象库编程之步骤生成器
- QTP中设置共享对象库
- 要设计,一个大家看得明白的设计
- Go语言
- Codeforces Round #139 (Div. 2) D. Snake
- Spring的Web-service和JAXB介绍
- 北京潮人海外联谊会普宁分会举行 2014年天下潮商经济发展座谈会
- QTP对象库管理 - 动态绑定对象库文件
- Calculate S(n)
- 纠正对viewstate的误解
- Linux C一站式学习习题答案8.3.1直方图
- 在 Windows 防火墙中打开端口
- keil编译器很奇怪的问题
- 【开源】Https数据读取C++实现
- Dijkstra算法
- 我不是什么