关于使用TestNG的retry问题
3、在测试申明中说明使用retry
@Test(retryAnalyzer = TestRetryAnalyzer.class)
4、加入一个我们自己的监听器
public class RetryTest {
public static void main(String args[]){
TestNG tng = new TestNG();
RetryTestListener rtl = new RetryTestListener();
XmlSuite xs = new XmlSuite();
Parser parser = new Parser("./testxml/temp.xml");
List<XmlSuite> suites = new ArrayList<XmlSuite>();
try {
suites = parser.parseToList();
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
};
tng.setXmlSuites(suites);
tng.addListener(rtl);
tng.run();
}
}