Accessing ComponentSettings variable directly from Step Settings

Is it possible to access a ComponentSettings variable via Step settings (without having to code out a step)?
For example, if I set an existing ComponentSettings variable to an an absolute path and in a TestStep, I would like to access the absolute path in the step settings and use it to run a shell script which needs an absolute base path. I’m looking to change the path in one place and use it across multiple steps.

1 Like

This should be possible. All Steps have access to the ComponentSettings. Does this example help with what you are trying to do?

Thanks @brennen_direnzo . I was hoping to find a way to use ComponentSettings directly in Step settings (e.g in the GUI) and not have to go into code. That way I can reuse something like SSH plugin → SSH Command Step and only have to write code for ComponentSettings

1 Like

Ah ok I get it. That is not possible with ComponentSettings today, but you could have a Parent Step that creates an Output and then use that to pass to other Step Settings. Or leverage Parameterizing Settings and merge them into a Setting at the Test Plan Level.

@rolf_madsen I wonder if we could expand the the Input/Output system to support ComponentSettings.

I guess we could support creating an Output from a ComponentSetting, but I’d rather make a test step that could read any property and then take that as an output.

@rolf_madsen : Could you elaborate on what you mean by: making a test step to read a property and take that as an output?

An example of my use case is:
I have a hierarchical directory structure with files in different directories (multiple config files in one directory, etc). I want to specify paths to those directories in my test step settings and append the filenames to those paths. So something like {MyBasePath1}/MyConfigFile1.txt would work great where MyBasePath1 could be specified in a ComponentSetting

1 Like

I was thinking something like this:

public class CombinePathStep : TestStep
{
    [Browsable(true)]
    public string String1 => MySettings.Current.BastPath1;
    public string String2{get;set} = "...";
    [Output]
    public string CombinedString => Path.Combine(String1, String2);
}

Thanks, @rolf_madsen . I’ll try to use this

1 Like