下面是一個C#調(diào)用QTP自動化對象模型的例子(簡單的C#調(diào)用QuickTest自動化對象模型的例子) using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Test7 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e)
{
// 創(chuàng)建QTP應(yīng)用程序?qū)嵗?
QuickTest.Application app = new QuickTest.Application();
// 啟動QTP
app.Launch();
// 讓QTP可見
app.Visible =true;
}
}
}
|