In the below code i am trying to automate gmail by data driven frame work using TestNg , but my code @Before annotation only executing not other two .Please healp me.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
public class LoginData {
WebDriver driver;
@Test
public void login() {
driver.findElement(By.linkText("Sign in")).click();
System.out.println("hello");
}
@BeforeTest
public void beforeTest() throws Exception {
WebDriver driver=new FirefoxDriver();
driver.get("https://www.gmail.com/intl/en/mail/help/about.html");
Thread.sleep(2000);
}
@AfterTest
public void fterTest() {
driver.close();
}
}