I have a test where I use SetRandom(out string outString) where I want the outString value to use [RandomizeStringSettings("QC {0}", 20)] but I want this string setting to only apply to a certain test - is there a way to set the RandomizeStringSettingsAttribute for a single test?
You can add Atata attributes dynamically to AtataContext in the beginning of a test method.
AtataContext.Current.Attributes.Global.Add(
new RandomizeStringSettingsAttribute("QC {0}", 20)
{
TargetParentType = typeof(SomePage),
TargetName = nameof(SomePage.SomeTextInput)
});
Alternatively, I would recommend for such scenario to just use Set and Randomizer.GetString methods to achieve the same.
page.SomeTextInput.Set(Randomizer.GetString("QC {0}", 20));