So basically I'm running a simple test on Intellij CE 14.1.4 trying to display on the console some messages, but I'm getting different results almost every time.It's driving me crazy... This doesn't happen on eclipse though.Here is the code:
package TestngFiles;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class Annot {
@BeforeMethod
public void userIdGeneratio(){
System.out.println("User id Generated");
}
@Test
public void aopenningBrowser(){
System.out.println("test");
}
@Test
public void flightBooking(){
System.out.println("Flight Booking");
}
}
And here are some results:
User id Generated
User id Generated
Flight Booking
Process finished with exit code 0
User id Generated
test
User id Generated
Flight Booking
Process finished with exit code 0
User id Generated
Process finished with exit code 0
This is know issue with IntelliJ TestNG plugin. IntelliJ itself is a great tool, but this plugin is substandard. It has bugs and it doesn't refer to most recent TestNG xml schema document. It has not been maintained for a good while, I wrote about that:
http://automatictester.co.uk/2014/03/16/intellij-idea-and-outdated-testng-j-plugin/
You should not rely on TestNG console output in IntelliJ, it is in permanent quirks mode. One time output will be here, another it won't. You can't do anything about it. Just live with it.