How can I get the value of "Actual Result" of a Test Step?

Description
kcpo
Posts: 2
Joined: Mon Jun 04, 2018 1:20 pm

How can I get the value of "Actual Result" of a Test Step?

Postby kcpo » Mon Jun 04, 2018 1:45 pm

Hello everyone,

how can I get the value of "Actual Result" of a Test Step for the use in a widget?

Many Thanks in Advance!

Best regards,
kcpo
Attachments
20180604_1544810_Screenshot.png
20180604_1544810_Screenshot.png (36.65 KiB) Viewed 1049 times

kcpo
Posts: 2
Joined: Mon Jun 04, 2018 1:20 pm

Re: How can I get the value of "Actual Result" of a Test Step?

Postby kcpo » Wed Jul 25, 2018 11:27 am

Hello everyone

the actual result of a TestStep is saved as Comment of the TestStepRecord.
Here a small code example on how to get the actual result in an widget.

Best regards
kcpo

Code: Select all

#set($runsArray=[])
#set($wpArray=[])
#set($wpProg=[])


#set( $projectId = $page.reference.projectId )
#set( $project = $trackerService.getProjectsService().getProject($projectId) )

#set($runs=$testManagementService.searchTestRuns("project.id:$page.reference.projectId", "id", 999))
#foreach ($run in $runs)
   #set($runDummy=$runsArray.add($run.getId))
#end

#foreach($run in $runs)
   #set($items = $trackerService.queryWorkItems($project, $run.createQueryForAllExecutedTestCases(), "id") )
   #foreach($item in $items)
      #set($testrecords=$testManagementService.getLastTestRecords($item, 1))
      #foreach($testrecord in $testrecords)
         #set($teststeprecords=$testrecord.getTestStepResults())
         #foreach($teststeprecord in $teststeprecords)
            #set($dummy=$wpProg.add($teststeprecord.getComment().getContent()))
            #set($dummy=$wpArray.add($item.getTitle()))
         #end
      #end
   #end
#end 


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 8 guests