Load order specific setings

Hallo,

For a while we have been using OpenTap for out production tests. But we run into a problem were we need to insert customisation settings into our DUT.

Inserting the settings is not te problem when these are ‘hard-coded’ into the testplan. However we now run into the challenge where customer ‘A’ requires settings ‘A’ and customer ‘B’ requires settings ‘B’. We do not prefer to make a new tapPlan for each of these settings, considering potential updates later on.

Our old test setup required a user input to select a config file. We are wondering if this is ‘the’ way to do this again, or if OpenTap already provides this in some manner.
I have looked through the documentation and forum, but was unable to find a solution.

Thanks in advance.

Hi @marc_vd_klooster and welcome to the forum!

If it is something that varies by-customer and not by-testplan it is probably best to implement it in a c setting somewhere (ComponentSettings). In this case probably DUT settings.

If you have a DUT class for each customer that inherits from the same base class or interface, they can have different settings each affecting how the test plan behaves. They can also do entirely different things depending on the context.

Maybe you could implement it like this:

// in the common plugin/DLL:
public interface IDutCommonStuff : IDut {
     void OnTheEvent(SomeContext context);
}

public class MyTestStepWhichUsesDut: TestStep {
     public IDutCommonStuff DutWhichCanDoStuff{get;set;}
    public override Run(){
        DutWhichCanDoStuff.OnTheEvent(this);
    }
}

// plugin for Customer A (Separate DLL)
public class CustomerADut : Dut, IDutCommonStuff {
    public void OnTheEvent(SomeContext context){
         context.DoThingWhichOnlyADoes();
    }
}

// plugin for Customer B  (Separate DLL)

class CustomerBDut : Dut, IDutCommonStuff {
    public void OnTheEvent(SomeContext context){
         context.DoThingWhichOnlyBDoes();
    }
}

Thanks for the suggestion.
We will take this into consideration when decide on what solution to use.