關(guān)于使用TestNG的retry問題
作者:
網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:
[ 2014/11/3 14:08:49 ] 推薦標簽:
TestNG 軟件測試工具
3、在測試申明中說明使用retry
@Test(retryAnalyzer = TestRetryAnalyzer.class)
4、加入一個我們自己的監(jiān)聽器
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();
}
}