TestStepsCount returns 0

BaldDude79 March 10, 2017

Hi,

I'm testing a template based on the Exporting a Test Execution example.

When I export the data from my Test Execution issue, the exported information all seem ok except for the TestStepsCount. For that field, I get 0.

I stripped the template to bare minimum, but still get a count of 0 when I should have 2.

 

Why is this value wrong?

 

Here is the template that I use. Since TestStepsCount = 0, the loop is not done. 

#Total of Test Runs
Test Runs Count: ${TestRunsCount}
Assignee Id: ${AssigneeId}
Assignee Name: ${AssigneeUserName}
 
#Iterating over Test Runs
#{for testruns}
    #Getting data from Pre-Condition
    Pre-Condition AssigneeId: ${TestRuns[n].PreCondition. AssigneeId}
    Pre-Condition Key: ${TestRuns[n].PreCondition.Key}
    Pre-Condition Summary: ${TestRuns[n].PreCondition.Summary}
    Condition:  ${TestRuns[n].PreCondition.Conditions}
      
    #Getting data from testruns
    Test AssigneeID: ${TestRuns[n].AssigneeId}
    Test Assignee Name: ${TestRuns[n].AssigneeUserName}
    Test Key: ${TestRuns[n].Key}
    Test Summary: ${TestRuns[n].Summary }
    Test Description: ${TestRuns[n].Description}

    #Iterating over Manual Test Steps from Test Run
    ${TestRuns[n].Key}.TestStepsCount: ${TestRuns[n].TestStepsCount}
    #{for r=TestRuns[n].TestStepsCount}
        StepNumber: ${TestRuns[n].TestSteps[r].StepNumber}
        Step: ${TestRuns[n].TestSteps[r].Step}
        Data: ${TestRuns[n].TestSteps[r].Data}
        Expected Result: ${TestRuns[n].TestSteps[r].ExpectedResult}
        Comment: ${TestRuns[n].TestSteps[r].Comment}
    #{end}
#{end}

1 answer

1 accepted

1 vote
Answer accepted
BaldDude79 March 10, 2017

Ok, I got it. It was because the tests had not been run.

When I run the tests, I get the proper count.

Doh!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events