Need to modify the source code of the Testresultcomparator class, the source of their own reportng official website http://reportng.uncommons.org/download, because the reportng default is sorted alphabetically by order, Now modified to be displayed in order of execution
Class TestresultcomparatorImplements comparator<itestresult> {Public Int Compare(Itestresult result1, Itestresult result2) {//sort by name show //return Result1.getname (). CompareTo (Result2.getname ()); //sorted by run time show int LONGRESULT2 = 0; if (Result1.getstartmillis ()) {longresult2 =-1;} else {longresult2 = 1;} span class= "kw" >return Longresult2;}} After the
modification is complete, you need to compile the testresultcomparator into a class file and replace the class file with the corresponding Testresultcomparator class file in the Reportng jar package.
/span>
Workaround for test reports generated by reportng that do not follow the test execution order