I'm new to gradle. I'm developing a selenium project for web testing.I have a requirement to get an one time argument when running the project using JVM arguments.Based on that argument I have some logic to execute inside the @Before method.This argument is "dev","qa","user"
What I have done was run the test project like this
./gradlew test -i -Puser:dev
Then I tried to access this variable in the @Before method like this
List inputArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
inputArgs.get(index)
But it doesn't give me any meaningful data or it does not have any argument with name user
Please give me an idea is this possible or of yes give me some help to correct this