# Extending Resource Class

**URL:** <https://forum.opentap.io/t/extending-resource-class/2622>\
**Category:** General\
**Created:** [January 20, 2026, 1:46pm UTC](https://forum.opentap.io/t/extending-resource-class/2622 "2026-01-20T13:46:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![t\_marius](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@t\_marius](https://forum.opentap.io/u/t_marius)\
**Post date:** [January 20, 2026, 1:46pm UTC](https://forum.opentap.io/t/extending-resource-class/2622/1 "2026-01-20T13:46:57Z")

</div>

Helllo,

As I’m going through the documentation of OpenTAP, I understand that the best practice is to let the engine handle open/close resources ( Intruments/Duts/etc). I have a new class which inherits from Resource ( so is not DUT or Instrument), how can I add this to the current session or Testplan resources to be opened closed automatically. The new class overrides Open/Close, and if im calling the methods from a test step it works ok. Thanks

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/2X/a/a3810b7d57a36aac27803abb9c97ef3cb55f26b1.png)

---

<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:** [January 20, 2026, 8:28pm UTC](https://forum.opentap.io/t/extending-resource-class/2622/2 "2026-01-20T20:28:13Z")

</div>

Hi @t_marius,

I believe the resources will get discovered automatically if they are being used in a public property of the test plan.

So if you have a test step setting like:

```cs
      public NotDutNotInstrumentResource MyResource {get;set;}

```

it should be managed by the resource manager and then Open should be called before the test step depending on it is executed (usually when the test plan starts).

---

<div class="post-metadata">

**Author:** ![t\_marius](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@t\_marius](https://forum.opentap.io/u/t_marius)\
**Post date:** [January 21, 2026, 6:50am UTC](https://forum.opentap.io/t/extending-resource-class/2622/3 "2026-01-21T06:50:18Z")

</div>

Tanks @rolf_madsen, that triggers the resource opening.

---

<div class="post-metadata">

**Author:** ![t\_marius](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@t\_marius](https://forum.opentap.io/u/t_marius)\
**Post date:** [February 10, 2026, 1:57pm UTC](https://forum.opentap.io/t/extending-resource-class/2622/4 "2026-02-10T13:57:24Z")

</div>

I just noticed that Im not able to create the new resource object in TestAutomation UI. @rolf_madsen Is there away to create a new tab under bench settings? which would eneble me to add a new resource similar to instrument/DUT? ChatGPT failed to help me create one. Thank you

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/2X/8/8a1a5fdeb503ae9bc80a6bd998e2b9e0e4a50424.png)

---

<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:** [February 11, 2026, 8:24am UTC](https://forum.opentap.io/t/extending-resource-class/2622/5 "2026-02-11T08:24:20Z")

</div>

Hi @t_marius,

You can, it looks like this:

```cs
 public interface IMyResource : IResource 
{
}

public class MyResource : Resource, IMyResource
{
}

// this will cause there to be a new list of resources under the "Bench" group of settings.
[SettingsGroup("Bench", Profile: true)]
public class MyResourceListSettings : ComponentSettingsList<MyResourceListSettings, IMyResource>
{
}

```

I recommend using an interface as the second generic type argument to ComponentSettingsList and let that implement from IResource. Then in your implementation you can inherit from Resource

---

<div class="post-metadata">

**Author:** ![t\_marius](https://avatars.discourse-cdn.com/v4/letter/t/59ef9b/32.png) [@t\_marius](https://forum.opentap.io/u/t_marius)\
**Post date:** [February 11, 2026, 8:57am UTC](https://forum.opentap.io/t/extending-resource-class/2622/6 "2026-02-11T08:57:04Z")

</div>

Works perfectly, thank you!

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opentap/original/2X/1/179475397b7b6a28d6890e85b8b5ccc633d69f9f.png)

---

<div class="post-metadata">

**Author:** ![msquillante](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@msquillante](https://forum.opentap.io/u/msquillante)\
**Post date:** [February 16, 2026, 6:39am UTC](https://forum.opentap.io/t/extending-resource-class/2622/7 "2026-02-16T06:39:38Z")

</div>

Hello,  
I am struggling to replicate the same in Python; anybody has a ready example?

Thanks!

---

<div class="post-metadata">

**Author:** ![msquillante](https://avatars.discourse-cdn.com/v4/letter/m/ecae2f/32.png) [@msquillante](https://forum.opentap.io/u/msquillante)\
**Post date:** [February 17, 2026, 2:18pm UTC](https://forum.opentap.io/t/extending-resource-class/2622/8 "2026-02-17T14:18:38Z")

</div>

Btw, as a workaround I resorted to define my ComponentSettingsList in a C# file and then use it in Python, but I would still be curious to know if there is an all-python solution for this.
