Boilerplate code for writing your java based selenium tests using testNG.
- The framework spawns the browsers (max. of 10) in the test
- The framework re-uses the browsers spawned for the remainder of the tests
Use the simple gradle syntax to run the test :
gradle clean test
Apart from the above, there are few env variables that can be used while executing the tests :
Purpose | Default Value | |
---|---|---|
selectedBrowser | Uses the value provided by the users to run the tests | chrome |
headless | Runs the tests in the browser's headless mode | false |
runOnGrid | Executes test on the grid if set to true else runs it on local | false |
Hence, in order to run the test on the grid for Firefox in headless mode we can use the below command :
gradle clean test -DselectedBrowser=Firefox -Dheadless=true -DrunOnGrid=true