generateBatchTestRuns

Generates test runs from multiple test cases. A SOAP error envelope is returned if the operation fails.

To generate manual test runs from one test case, use generateTestRuns.

Parameters

Parameter Type Description
cookie long Session cookie returned by projectLogon.
testCases long[] List of unique test case record IDs.
testVariants CTestCaseVariantField[] List of test variants to use.
testRunSet string Manual test run to add the generated manual test runs to. The run set must already exist in the project. Use getDropdownFieldValuesForTable to retrieve a list of run sets.

Return value

Value Type Notes
pResults CBatchTestRunResult[] Contains the record IDs of the generated test runs and any errors that occurred.

Example

long ttCookie = ttSoapApp.ProjectLogon(project, ttUser, ttPassword);

string ttTestRunSet = "RunSet1";

 

// Build array of test run variants

ttsoap.CTestRunVariantField[] ttRunVariants = new ttsoap.CTestRunVariantField[1];

ttRunVariants[0] = new ttsoap.CTestRunVariantField();

ttRunVariants[0].name = "OS";

ttRunVariants[0].values = new ttsoap.CFieldValue[2];

ttRunVariants[0].values[0] = new ttsoap.CFieldValue();

ttRunVariants[0].values[0].value = "Windows";

ttRunVariants[0].values[1] = new ttsoap.CFieldValue();

ttRunVariants[0].values[1].value = "Mac";

 

// Set the test case IDs

long[] testCaseIds = new long[4];

testCaseIds[0] = 24;

testCaseIds[1] = 29;

testCaseIds[2] = 94;

testCaseIds[3] = 1143;

 

try

{

ttsoap.CBatchTestRunResult results = ttSoapApp.generateBatchTestRuns(ttCookie, testCaseIds, ttRunVariants, ttTestRunSet);

// Log generated test runs

Logger.log("--- Test runs generated ---");

for(int index = 0; index < results.testRunList.Length; index++)

{

String testRunID = results.testRunList[index].recordid.ToString();

Logger.log("Test Run ID = " + testRunID);

}

// Log errors

Logger.log("--- Errors ---");

for(int index = 0; index < results.errorList.Length; index++)

{

long errorType = results.errorList[index].errorType;

long entityType = results.errorList[index].entityType;

long entityID = results.errorList[index].entityID;

String errorStr = results.errorList[index].errorString;

Logger.logTestRunError(errorType, entityType, entityID, errorStr);

}

}

catch (Exception fcc)

{

String errString = fcc.Message;

Logger.log(errString);

}

ttSoapApp.DatabaseLogoff(ttCookie);