Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97799

Junit pass some values from @Test methods into a @Rule method

$
0
0

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"
}

Viewing all articles
Browse latest Browse all 97799

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>