C# AOM QTP

用C#实现QTP的启动和Add-Ins的加载。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Launch QTP 
QuickTest.Application qtpApp = new QuickTest.Application();
string[] arrAddins = dpString.dpSplit(FrameHelper.GetGlobalSetting()["Addins"], ",");
object AddinNames = arrAddins;
object ErrorDescrition = "";
if (qtpApp.SetActiveAddins(ref AddinNames, out ErrorDescrition))
{
FrameHelper.WriteLogToFile(DateTime.Now.ToString("HH:mm:ss") + " Message: Load Add-ins successfully.");
}
else
{
FrameHelper.WriteLogToFile(DateTime.Now.ToString("HH:mm:ss") + " Error: Meet an error when loading Add-ins: " + ErrorDescrition);
}
qtpApp.Launch();

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!