need of main() method in test automation framework
There is always a need to write a main method for a program. Without a main method in java programs interpreter will not know where to start from.
Now coming to your point
– In TestNg frameworks we dont need a main method because TestNG has that main method which loads you test classes.
– In custom frameworks you have to have a main method, you can compile without a main method but you cannot actually run it.
If you look at your custom framework you will find one main method which will load all your test classes. That why you might not need a main in the test classes.