Cant iterate tests in test set

BaldDude79 March 8, 2017

Hi, 

I'm trying to iterate tests in a test set. when I use the following syntax, I get the expected results.:

Tests[0].TestSteps[0].StepNumber: ${Tests[0].TestSteps[0].StepNumber}
Tests[0].TestSteps[0].Step: ${Tests[0].TestSteps[0].Step}
Tests[0].TestSteps[0].Data: ${Tests[0].TestSteps[0].Data}
Tests[0].TestSteps[0].ExpectedResult:
${Tests[0].TestSteps[0].ExpectedResult}

 

But when I try to iterate in a loop, I don't get anything. I use the following syntax:

&{for
issues|filter=%{'${IssueTypeName}'.equals('Test
Set')}}
#{for tests}
    ${Tests[n].Key}
    ${Tests[n].Summary}
    ${Tests[n].Description}
#{end}
&{end}

 

My question is: Why does it work when I hardcode the array index, but not when I iterate in a for loop?

 

Thanks for your help.

6 answers

1 accepted

0 votes
Answer accepted
Rui Rodrigues
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2017

Your template has some typos. I've fixed it. Please try it.

0 votes
BaldDude79 March 8, 2017

Thanks, that's perfect.

0 votes
BaldDude79 March 8, 2017

I stripped most of it and left the part that won't work. The green part works.

0 votes
Rui Rodrigues
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2017

I've checked in my local Environment and it's working as expected.

Can you share your template?

0 votes
BaldDude79 March 8, 2017

Xporter : 5.0.0

Xray: 2.0.10

 

They are trial version, but I dougt that it has anything to do.

0 votes
Rui Rodrigues
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2017

Hi,

Which versions are you using?

Cheers.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events