您的位置:軟件測(cè)試 > 開(kāi)源軟件測(cè)試 > 開(kāi)源單元測(cè)試工具 > TestNG
關(guān)于使用TestNG的retry問(wèn)題
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2014/11/3 14:08:49 ] 推薦標(biāo)簽:TestNG 軟件測(cè)試工具

  3、在測(cè)試申明中說(shuō)明使用retry
  @Test(retryAnalyzer = TestRetryAnalyzer.class)
  4、加入一個(gè)我們自己的監(jiān)聽(tīng)器
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();
}
}

上一頁(yè)12下一頁(yè)
軟件測(cè)試工具 | 聯(lián)系我們 | 投訴建議 | 誠(chéng)聘英才 | 申請(qǐng)使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd