Thursday, September 23, 2010

QTP c# Integration

If you want to call qtp scripts from c# application , here i am to help with my tested code

first you have to make a reference to QTObjectModelLib.dll

using QTObjectModelLib;
QTObjectModelLib.Application qt;
qt = new QTObjectModelLib.Application();
qt.Launch();

qt.Visible = false;
qt.Options.Run.RunMode = "Fast";
qt.Open("C:\\Project QTP\\BUYNSE", true, true);

QTObjectModelLib.RunResultsOptions qtr;
qtr = new QTObjectModelLib.RunResultsOptions();
qtr.ResultsLocation = "c:\\resultsc";

//QTObjectModelLib.Application qttest;
//qttest = new QTObjectModelLib.Application();

qt.Test.Run(qtr, true, qt);

qt.Quit();


No comments: