I'm having trouble getting the correct driver instance. my next setting
public class SeleniumBase{
public static WebDriver driver;
public static void setUp(url,browser,port){
driver = new FirefoxDriver();
}
public static void tearDown(){
driver.manage().deleteAllCookies();
driver.close();
driver.quit();
}
}
public class BuildTest extends SeleniumBase{
@BeforeClass
public static void seleniumSetup(){
try{
url = prop.getProp("baseUrl");
browser = prop.getProp("browser");
port = prop.getProp("port");
}
SeleniumBase.setUp(url,browser,port);
waitForLoginPage();
App.login();
}
@AfterClass
public static void seleniumTearDown(){
App.logOut();
SeleniumBase.tearDown();
}
}
@RunWith(Suite.class)
@Suite.SuiteClasses(
{
Test1.class,
Test2.class
})
public class SmokeSuite {
}
now everything works fine for Test1.class, but when Test2.class is called from the package, a new driver instance is created using the setUp method, but App.Login () throws an error saying "The FirefoxDriver cannot be used after quit() was called"
Is there something wrong in my setup / break ..?
source
share