1

TestNg の @AfterTest アノテーションでテスト ケースのステータスを取得する方法。@AfterTest でテスト ケースが成功または失敗した場合、いくつかのアクションを実行する必要があります。

@AfterTest(alwaysRun=true)
public void teardown(ITestContext test) throws Exception {

  String testcase = test.getCurrentXmlTest().getParameter("id");
} 
4

2 に答える 2

0

The Problem is that ITestContext is global, and not specific to the test. What you need is to have a Listener, and have it execute OnTestFailure

http://testng.org/doc/documentation-main.html#testng-listeners

于 2013-09-15T15:36:01.340 に答える