0
我试图访问ISuite时运行套件设置每个测试将需要的属性。TestNG访问@BeforeSuite中的ISuite
以下是代码:
公共类SingleTester {
IAttributes attributes;
@BeforeSuite
public void setup(ISuite suite)
{
attributes = suite;
attributes.setAttribute("test", "car");
createAccount();
}
....
问题是测试失败,出现以下消息:
org.testng.TestNGException:
Method setup requires 1 parameters but 0 were supplied in the @Configuration annotation.
有什么不对?我如何从@BeforeSuite函数访问ISuite对象?
Thx提前。
ITestContext是在每个测试中创建的,我需要的是跨越多个测试的上下文。 –
@ isaac.hazan plese,查看更新的答案。 – user1058106