I've got four junit cases and I need to pass them a parameter, that is the same for all of them, but this parameter is created in a dynamic way in the test suite. How can I pass a parameter from the test suite to all the tests in the test case?
If its just a string parameter, you can set the System Property and access it in test cases.
If you want to programmatically do it, you can do it at one place System.setProperty("x","123");
otherwise you can always pass System properties from command line as -Dx=123
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With