method -> class -> test -> suite
@BeforeSuite/@AfterSuite 在testng定义的xml根元素里面的所有执行之前/后运行@BeforeTest/@AfterTest 在一个元素定义的所有里面所有测试方法执行之前/后运行@BeforeClass/@AfterClass 在当前测试类的第一个测试方法执行之前/最后一个测试方法执行之后运行@BeforeMethod/@AfterMethod 在当前测试类的每一个测试方法执行之前/后运行@BeforeGroup/@AfterGroup 在同个组的第一个测试方法之前/最后一个测试方法之后运行2.在@Test中添加priority属性
priority小,先执行; @Test(priority = 1) public void test01() throws Exception { }testng和priority同时配置时,priority的优先级高
