青春与成就 是人生的两大财富 / 当你享受青春时 你必须要吃点苦 / 当你失去青春时 成就会成为你的拥有 / 否则 青春之后就一无所有

转:一个简单的C#调用QTP自动化对象模型的例子

上一篇 / 下一篇  2008-06-05 16:47:52 / 个人分类:QTP

转自:http://blog.csdn.net/Testing_is_believing/archive/2008/01/07/2029448.aspx

使用QTP自动化对象模型提供的对象、方法和属性,可以编写脚本来设置QTP、运行测试,而不需要在QTP的界面上手工进行。

下面是一个简单的C#调用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)

       {

 

           //创建QTP应用程序实例

           QuickTest.Application app = new QuickTest.Application();

 

           //启动QTP

           app.Launch();

 

           //QTP可见

           app.Visible =true;

 

       }

   }

}


TAG: QTP

 

评分:0

我来说两句

日历

« 2024-04-17  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 17681
  • 日志数: 33
  • 建立时间: 2008-03-07
  • 更新时间: 2008-09-22

RSS订阅

Open Toolbar