|
我在C#.NET编程环境中添加了对QTP9.0 对象模型库的引用,用以编写QTP自动化测试程序。代码如下:
QuickTest.ApplicationClass qtApp = new QuickTest.ApplicationClass();
qtApp.Launch();
qtApp.New(false);
QuickTest.WebLauncher web = (QuickTest.WebLauncher)qtApp.Test.Settings.Launchers["Web"];
web.Active = true;
web.Browser = "IE";
web.Address = "http://newtours.mercury.com";
web.CloseOnExit = true;
qtApp.Test.Settings.Web.ActiveScreenAccess.UserName = "wslqq2008";
qtApp.Test.Settings.Web.ActiveScreenAccess.Password = "askwslqq";
qtApp.Test.Settings.Web.BrowserNavigationTimeout = 60000;
qtApp.Visible = true;
在执行qtApp.New(false);这一代码行时,弹出了一个异常:An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll
Additional information: RPC 服务器不可用。
请问是什么原因引起的这个异常?有何解决方法?
衷心感谢你的帮助! |
|