??????????????????????????????£?
???????????????????????????????????ι????????@Test??????@Parameters????testng.xml?д???????????????????????ι??????????У??????????????@Test????dependsOnMethods?????????????ι???????
???????????????????????£?
package com.ibm.testng.test;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
public class WebTest {
//Times staying on the server
private int stayTime;
//Constructor with params
@Test
@Parameters({"stayTime"})
public WebTest(int stayTime) {
System.out.println("Constructor with parameter!");
this.stayTime = stayTime;
}
@Test(dependsOnMethods="WebTest")
public void stayOnServer() {
System.out.println("The times staying on server: " + stayTime);
}
}
????????????

??????????????????????????????????stayOnServer()????????????WebTest()???????????????????????WebTest()??????????????@Test??????????????????????
?????????????TestNG?????????й??TestNG??????????ù????????????е???????????????в????????????????????????????????????????????????в????????????У???б???????@Test??dependsOnMethods?????????????????????????