generateTestRuns

Generates test runs from one test case. A SOAP error envelope is returned if the operation fails.

To generate manual test runs from multiple test cases, use generateBatchTestRuns.

Parameters

Parameter Type Description
cookie long Session cookie returned by projectLogon.
recordID long Unique test case record ID.
testVariants CTestCaseVariantField[] List of test variants to use when generating test runs.
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 CItemToTrack[] Contains the record IDs of the generated test runs.

Example

CTestCase tc = ttsdk.getTestCase(cookie, 0, "Test case summary", false);

 

int variantCount = 0;

 

// Calculate how many included variants the test case has

foreach (CTestCaseVariantField variant in tc.testVariants)

{

if (variant.type == "Included")

{

variantCount++;

}

}

 

CTestRunVariantField[] trVariants = new CTestRunVariantField[variantCount];

 

// Populate trVariants with all of the included variants available for this test case

for (int x = 0; x < tc.testVariants.Length; x++)

{

if (tc.testVariants[x].type == "Included")

{

CFieldValue[] tVariantValues = new CFieldValue[tc.testVariants[x].values.Length];

 

// Go through each value in this variant

for (int i = 0; i < tc.testVariants[x].values.Length; i++)

{

tVariantValues[i] = new CFieldValue();

tVariantValues[i].value = tc.testVariants[x].values[i].value;

}

 

trVariants[x] = new CTestRunVariantField();

trVariants[x].name = tc.testVariants[x].name;

trVariants[x].values = tVariantValues;

}

}

 

CItemToTrack[] genTestRuns = ttsdk.generateTestRuns(cookie, tc.recordid, trVariants, "Test run set");