Task.execute()
should never be called from a script assembly (bad things can happen if you do this). To call this method before Gradle. The way to set the system properties for the test
task:
test { systemProperty "driver", "firefox" }
System.setProperty()
will not have any effect, because tests are always executed in a separate JVM.
source share