# \[python\] Accessing attributes and verdict of test plan reference

**URL:** <https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223>\
**Category:** Technical\
**Tags:** python\
**Created:** [November 26, 2024, 8:26am UTC](https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223 "2024-11-26T08:26:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jb111](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jb111](https://forum.opentap.io/u/jb111)\
**Post date:** [November 26, 2024, 8:26am UTC](https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223/1 "2024-11-26T08:26:13Z")

</div>

I have a test plan consisting of a sequence of test plan references. I would like to access the test plan references’ name, verdict and perhaps start time. If possible, I’d prefer to access the test plan references from another test step.

As far as I can tell it isn’t publishing any results when I add the CSVResultListener as a resource, but perhaps they can still be accessed.

Any help to how this can be done is highly appreciated.

---

<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:** [November 26, 2024, 12:12pm UTC](https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223/2 "2024-11-26T12:12:27Z")

</div>

Hi @jb111,

The CSVResultListener only becomes active when actual results are published, so if only start/completed events gets registered not much will happen.

If you make another implementation of result listener you can record the data you are interested in.

How do you want to process the data?

---

<div class="post-metadata">

**Author:** ![jb111](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jb111](https://forum.opentap.io/u/jb111)\
**Post date:** [November 26, 2024, 1:36pm UTC](https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223/3 "2024-11-26T13:36:18Z")

</div>

Alright I think I understand.

My intentions are to record each verdict, name and timestamp for processing through e.g. a dictionary or similar. Finally, the plan is to create a document (.pdf or .docx) with a table containing the result of each test plan reference per row.

---

<div class="post-metadata">

**Author:** ![jb111](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jb111](https://forum.opentap.io/u/jb111)\
**Post date:** [December 4, 2024, 8:07am UTC](https://forum.opentap.io/t/python-accessing-attributes-and-verdict-of-test-plan-reference/2223/4 "2024-12-04T08:07:45Z")

</div>

I’ve resolved my issue.  
I couldn’t find any documentation on available attributes of test steps and test plans when using a ResultListener, so instead I listed all the objects’ attributes to get an idea.

From there I found the attributes that I needed in my case (luckily they existed) and could proceed from there.

In python it looks like this:

```csharp
def OnTestPlanRunCompleted(self, planRun, logStream):
        """Handle test plan completion event."""
       attrs = dir(planRun)
       for attr in attrs:
              print(f"Attribute: {attr}")

```

and similarly for OnTestStepCompleted
