I use Junit to run tests as part of Selenium framework. I need to record some values from the actual test methods into another method.
@Rule
public final RuleChain rules =
RuleChain.outerRule(
Watcher.newBuilder()
.addCustomProperty("key", "value")
.addCustomProperty("key", "value")
.addCustomProperty("key", "value")
);
@Test
public void someTest() {
String a = "newValue"; //this need to be passed into @Rule "value"
String b = "newValue"; //this need to be passed into @Rule "value"
String c = "newValue"; //this need to be passed into @Rule "value"
}