# Can I publish result in PostPlanRun

**URL:** <https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377>\
**Category:** Technical\
**Created:** [July 7, 2021, 6:14am UTC](https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377 "2021-07-07T06:14:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![darwin](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@darwin](https://forum.opentap.io/u/darwin)\
**Post date:** [July 7, 2021, 6:14am UTC](https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377/1 "2021-07-07T06:14:54Z")

</div>

In my test sequence, I have to wait until all tests are executed before I can publish the results. So I tried publishing results during PostPlanRun, Is this possible?

When I try I am encountering this error :

```csharp
12:38:34.980 ResultProxy Caught exception in result handling task.
12:38:34.996 ResultProxy Exception: OnResultPublished called without associated step run.
12:38:35.013 ResultProxy at Keysight.OpenTap.Plugins.Csv.CsvResultListener.OnResultPublished(Guid stepRunId, ResultTable result)
12:38:35.013 ResultProxy at OpenTap.ResultSource.Propagate(IResultListener rt, ResultTable result)
12:38:35.013 ResultProxy Exception caught at:
12:38:35.075 ResultProxy at Void Process()
12:38:35.075 ResultProxy at Void processQueue()
12:38:35.075 ResultProxy at Void RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
12:38:35.075 ResultProxy at Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
12:38:35.075 ResultProxy at Void Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
12:38:35.075 ResultProxy at Void ThreadStart()
12:38:35.075 TestPlan Removing faulty ResultListener 'CSV'

```

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [July 7, 2021, 3:36pm UTC](https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377/2 "2021-07-07T15:36:09Z")

</div>

@darwin this is not possible currently. There are two possible approaches:

1. Make the results from each Step a property rather then publishing, and use the [Output] attribute. Then have a second “Collector” step that accepts all these Outputs and does the Publish

2. Create a Parent “Collector” step. Similar to above. Rather than each step “Publishing” results just set a property, and have the Parent step call Results.Publish.

---

<div class="post-metadata">

**Author:** ![darwin](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@darwin](https://forum.opentap.io/u/darwin)\
**Post date:** [July 8, 2021, 1:25am UTC](https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377/3 "2021-07-08T01:25:51Z")

</div>

Thanks @brennen_direnzo

---

<div class="post-metadata">

**Author:** ![david-wsd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/david-wsd/32/204_2.png) [@david-wsd](https://forum.opentap.io/u/david-wsd)\
**Post date:** [July 8, 2021, 4:37pm UTC](https://forum.opentap.io/t/can-i-publish-result-in-postplanrun/377/4 "2021-07-08T16:37:41Z")

</div>

@brennen_direnzo I do option 2, the parent collector step. It’s a vital underpinning of our test plan design.

Maybe a third option would be for the result listener itself to do the collecting, then write all the results from within its OnTestPlanRunCompleted method. Probably not as clean or generic of a solution.
