Any method with preannotation "@Test" consider as test case in that program.
Program can have any number of such methods with annotation @Test which will run one by one.
Inside the method with annotation @Test, we write our whole script for single test case.
Ex:
@Test(priority=0)
@Parameters ({"sBrowser"})
public void alreadyLoggedIn(String browser)
{
//Execute it if user is already logged in
Reporter.log("I am in "+browser);
try {
if(!ele1.getText().equalsIgnoreCase("Visitante"))
{
act1=builder.moveToElement(ele1).build();
act1.perform();
driver.findElement(By.linkText("Sair")).click();
Log.info("Already Logged in user successfully LOGOUT");
driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
}
} catch (Exception e) {
Log.info(e.toString());
}
}