public class Reg {
@BeforeClass
public void setUp() throws Exception
{
// Generate a unique email every time
String email= UniqueEmail.now()+"@test.com";
.....
}
@Test()
public void Reg1() throws Exception
{
// Registration Test
}
}
public class Login{
@BeforeClass
public void setUp() throws Exception
{
//How to parse in the email variable from Class Reg?
}
@Test()
public void Login() throws Exception
{
// Use the email generated from class A
selenium.type("EmailID", email)
}
}
Class Reg
will always be executed before Class Login
. How can I store the email
variable after executing Class Reg
so that it can be used in Class Login
?