Public class BaseTest{
String name = null;
int ID= 0;
@AfterMethod
Public void printNameID(String orgName, int newID){
name = orgName ;
ID = newID;
System.out.println(name + ID);
}
}
Public class Test1 extends BaseTest{
String orgName = “xyz”;
@TestNG
Public void test1(){
int ID = 1;
}
@TestNG
Public void test2(){
int ID = 2;
}
}
After I run my tests, I would like to see following in console:
xyz1
Xyz2
I know my codes are totally wrong. I am not sure what parameter type to use to pass name and ID to @aftermethod annotation. How can i pass ID and orgName from TestNG tests to @AfterMethod annotation?
Thanks!
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/364356cb-1ef0-451c-b961-d2ef5d3cd143n%40googlegroups.com.