我試圖從一個測試通過參數去另一個使用ITestContext:無法從一個測試通過參數去其他使用ITestContext返回NULL(TestNG的+ JAVA)
public class One {
int waterfallId;
@Test()
public void testOne(ITestContext ctx) {
/*here waterfallId was initialized*/
ctx.setAttribute("waterfallId", waterfallId);
}
@Test()
public void testTwo(ItestContext ctx) {
ctx.getAttribute("waterfallId"); //returns null
}
}
有什麼不對?任何其他方式來解決這個問題?