Skip to content

Instantly share code, notes, and snippets.

@fijiaaron
Created November 20, 2012 21:34
Show Gist options
  • Save fijiaaron/4121324 to your computer and use it in GitHub Desktop.
Save fijiaaron/4121324 to your computer and use it in GitHub Desktop.
Run a TestSet in QualityCenter using the OTA API
using System;
using TDAPIOLELib;
namespace oneshore.qcintegration.examples
{
class RunTestSet
{
public static void Main()
{
String qcUrl = "http://localhost:8080/qcbin";
String qcDomain = "oneshore";
String qcProject = "QCIntegration";
String qcLoginName = "aaron";
String qcPassword = "secret";
String testSetPath = @"ROOT\path\to\testset";
String testSetName = "TestSet name";
TDConnection connection = new TDConnection();
connection.InitConnectionEx(qcUrl);
connection.ConnectProjectEx(qcDomain, qcProject, qcLoginName, qcPassword);
TestSetFactory testSetFactory = connection.TestSetFactory;
TestSetTreeManager testSetTreeManager = connection.TestSetTreeManager;
TestSetFolder testSetFolder = (TestSetFolder) testSetTreeManager.NodeByPath[testSetPath];
List testSetList = testSetFolder.FindTestSets(testSetName);
TestSet testSet = testSetList[0];
TSScheduler scheduler = testSet.StartExecution("");
scheduler.RunAllLocally = true;
scheduler.Run();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment