51Testing软件测试论坛

标题: QTP运行时报错 [打印本页]

作者: selftest    时间: 2010-5-18 11:11
标题: 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
库文件有语法错误,或者是文件格式不对
作者: selftest    时间: 2010-5-25 10:14
谢谢大家的帮助,这个问题我找到了答案,在菜单栏file下面单击settings子菜单项,在打开的新窗口中有一个resources的选项卡,里面是维护function libraries的,之前我那个报错是因为这里的文件路径没有维护好
作者: yahuu    时间: 2010-5-25 11:21
file>>settings>>Properties>>Generate Script...

点击这个按钮之后,就可以生成你的qtp环境设置的一个vbs文件,以后只要维护它就可以,只要你记得有这个文件要维护,那么基本不会出这样的错了。
比如我导出来我的就是:
  1. Dim App 'As Application
  2. Set App = CreateObject("QuickTest.Application")
  3. App.Launch
  4. App.Visible = True
  5. App.Test.Settings.Launchers("Web").Active = False
  6. App.Test.Settings.Launchers("Web").Browser = "IE"
  7. App.Test.Settings.Launchers("Web").Address = "http://newtours.mercury.com "
  8. App.Test.Settings.Launchers("Web").CloseOnExit = True
  9. App.Test.Settings.Launchers("Windows Applications").Active = False
  10. App.Test.Settings.Launchers("Windows Applications").Applications.RemoveAll
  11. App.Test.Settings.Launchers("Windows Applications").RecordOnQTDescendants = True
  12. App.Test.Settings.Launchers("Windows Applications").RecordOnExplorerDescendants = False
  13. App.Test.Settings.Launchers("Windows Applications").RecordOnSpecifiedApplications = True
  14. App.Test.Settings.Run.IterationMode = "rngAll"
  15. App.Test.Settings.Run.StartIteration = 1
  16. App.Test.Settings.Run.EndIteration = 1
  17. App.Test.Settings.Run.ObjectSyncTimeOut = 20000
  18. App.Test.Settings.Run.DisableSmartIdentification = False
  19. App.Test.Settings.Run.OnError = "Dialog"
  20. App.Test.Settings.Resources.DataTablePath = "<Default>"
  21. App.Test.Settings.Resources.Libraries.RemoveAll
  22. '下面两行是我随便引入的两个vbs文件地址,这就是你说的Resources,如果还需要,再加行就可以。
  23. App.Test.Settings.Resources.Libraries.Add("E:\NVSdoc\VBS\Install.vbs")
  24. App.Test.Settings.Resources.Libraries.Add("E:\NVSdoc\VBS\Stop.vbs")
  25. App.Test.Settings.Web.BrowserNavigationTimeout = 60000
  26. App.Test.Settings.Web.ActiveScreenAccess.UserName = ""
  27. App.Test.Settings.Web.ActiveScreenAccess.Password = ""
复制代码





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2