selftest 发表于 2010-5-18 11:11:47

QTP运行时报错

qtp运行时提示(Run Error)Error in library file.Your function library may not be valid.Do you want to continue running the test?

TIB 发表于 2010-5-18 14:52:59

库文件有语法错误,或者是文件格式不对

selftest 发表于 2010-5-25 10:14:50

谢谢大家的帮助,这个问题我找到了答案,在菜单栏file下面单击settings子菜单项,在打开的新窗口中有一个resources的选项卡,里面是维护function libraries的,之前我那个报错是因为这里的文件路径没有维护好

yahuu 发表于 2010-5-25 11:21:38

file>>settings>>Properties>>Generate Script...

点击这个按钮之后,就可以生成你的qtp环境设置的一个vbs文件,以后只要维护它就可以,只要你记得有这个文件要维护,那么基本不会出这样的错了。
比如我导出来我的就是:Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Launchers("Web").Active = False
App.Test.Settings.Launchers("Web").Browser = "IE"
App.Test.Settings.Launchers("Web").Address = "http://newtours.mercury.com "
App.Test.Settings.Launchers("Web").CloseOnExit = True
App.Test.Settings.Launchers("Windows Applications").Active = False
App.Test.Settings.Launchers("Windows Applications").Applications.RemoveAll
App.Test.Settings.Launchers("Windows Applications").RecordOnQTDescendants = True
App.Test.Settings.Launchers("Windows Applications").RecordOnExplorerDescendants = False
App.Test.Settings.Launchers("Windows Applications").RecordOnSpecifiedApplications = True
App.Test.Settings.Run.IterationMode = "rngAll"
App.Test.Settings.Run.StartIteration = 1
App.Test.Settings.Run.EndIteration = 1
App.Test.Settings.Run.ObjectSyncTimeOut = 20000
App.Test.Settings.Run.DisableSmartIdentification = False
App.Test.Settings.Run.OnError = "Dialog"
App.Test.Settings.Resources.DataTablePath = "<Default>"
App.Test.Settings.Resources.Libraries.RemoveAll
'下面两行是我随便引入的两个vbs文件地址,这就是你说的Resources,如果还需要,再加行就可以。
App.Test.Settings.Resources.Libraries.Add("E:\NVSdoc\VBS\Install.vbs")
App.Test.Settings.Resources.Libraries.Add("E:\NVSdoc\VBS\Stop.vbs")
App.Test.Settings.Web.BrowserNavigationTimeout = 60000
App.Test.Settings.Web.ActiveScreenAccess.UserName = ""
App.Test.Settings.Web.ActiveScreenAccess.Password = ""
页: [1]
查看完整版本: QTP运行时报错