# How Can I Get the Name of the test step in OnResultPublished of a ResultListener?

**URL:** <https://forum.opentap.io/t/how-can-i-get-the-name-of-the-test-step-in-onresultpublished-of-a-resultlistener/1281>\
**Category:** General\
**Created:** [October 24, 2023, 2:55am UTC](https://forum.opentap.io/t/how-can-i-get-the-name-of-the-test-step-in-onresultpublished-of-a-resultlistener/1281 "2023-10-24T02:55:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@allen](https://forum.opentap.io/u/allen)\
**Post date:** [October 24, 2023, 2:55am UTC](https://forum.opentap.io/t/how-can-i-get-the-name-of-the-test-step-in-onresultpublished-of-a-resultlistener/1281/1 "2023-10-24T02:55:48Z")

</div>

How Can I Get the Name of test step in the function OnResultPublished of a ResultListener?  
public override void OnResultPublished(Guid stepRun, ResultTable result)  
{  
}

---

<div class="post-metadata">

**Author:** ![rolf\_madsen](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@rolf\_madsen](https://forum.opentap.io/u/rolf_madsen)\
**Post date:** [October 24, 2023, 7:37am UTC](https://forum.opentap.io/t/how-can-i-get-the-name-of-the-test-step-in-onresultpublished-of-a-resultlistener/1281/2 "2023-10-24T07:37:44Z")

</div>

Hi @allen,

The typical way of doing this is to keep track of active test step runs using a dictionary, mapping GUID to TestStepRun.

Since we had no example of it I have added one in a pull request, maybe you could check it out.

Its on Github: [Example Result Listener](https://github.com/opentap/opentap/blob/be604866bacda336b38115ae7473ba1ff0cf8eaf/sdk/Examples/PluginDevelopment/ResultListeners/ExampleResultListener.cs)

Look for what is done with `activeTestStepRuns`.

---

<div class="post-metadata">

**Author:** ![allen](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@allen](https://forum.opentap.io/u/allen)\
**Post date:** [October 24, 2023, 8:01am UTC](https://forum.opentap.io/t/how-can-i-get-the-name-of-the-test-step-in-onresultpublished-of-a-resultlistener/1281/3 "2023-10-24T08:01:21Z")

</div>

> [@rolf\_madsen](#):
>
> activeTestStepRuns

Got it, thank you very much for your example.
