标题: 加载VBS文件到 Library 库中出错。 [打印本页] 作者: jino007 时间: 2010-11-25 11:04 标题: 加载VBS文件到 Library 库中出错。 加载VBS文件到 Library 库中出“This operation cannot be performed during a run session.”错误。
Dim obj ,qtLibraries
Set obj = CreateObject("QuickTest.Application")
Set qtLibraries = obj.Test.Settings.Resources.Libraries
If qtLibraries.Find( TaskVbsFilePaths)=-1Then
msgbox TaskVbsFilePaths
qtLibraries.Add TaskVbsFilePaths,3
End If
请问哪里出错了作者: TIB 时间: 2010-11-25 15:54
这些代码要在QTP之外用VBS文件执行作者: jino007 时间: 2010-11-26 10:32
If DataTable("IDX",TEST_SHEET) = "√" Then
taskFileName = DataTable("bizName",TEST_SHEET)
If NOT taskFile.Exists(taskFileName) Then
taskFilePath = pathFind(Environment("testScriptFolderName"),taskFileName,"vbs")
call taskFile.add(taskFileName,taskFilePath)
ExecuteFile taskFilePath '加载task脚本文件
logPrint("加载Task脚本文件完成。"&taskFilePath)
Execute "Set obj"&taskFileName&" = new "&taskFileName '初始化task的类
End If
End If
DataTable.GetSheet(TEST_SHEET).SetNextRow
Next