How to run Before method only once in Junit

Hello friends,

Today we will see some workaround in order to run the @Before method only once in our test execution.

As the @BeforeClass method is static, we may sometime face issues in getting the data from our config file(Depends on the automation framework) hence to curb this issue we can make the @Before method run only once.

By using the above code, your @Before method will run only once.