Need help with @AfterTest | Selenium Forum
Posted on 22/08/2015
Hi Ashish,

why is my code not quitting the browser. Could you please tell me the mistake I am making.

I am looking for a simple test case using data driven creating 2 accounts with different username and password. Could you please tell me which module should I check. I dont want to create the entire framework.


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.Test;

public class CreateAccount {

WebDriver driver;

public void account(){

WebDriver driver = new FirefoxDriver();

//Login to the user with the email and the password and click the login button

public void close() throws InterruptedException{


Replied on 23/08/2015

WebDriver driver = new FirefoxDriver();
in @ test should be
driver = new FirefoxDriver();

Dont create new driver object. It will hide global one

For a simple parameterization example.. look at video 17 exrcises