My question is as follows: How can I reuse a browser session for tests that are in different java classes? I have the browser open like this:
public class OpenBrowser {
public static WebDriver driver;
@BeforeSuite
public static void openb() {
// Create a new instance of the Firefox driver
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
}
Then I have to log into a website using some credentials and after it's logged I want to perform other tests, I do not want to log in for every test because there are a lot of them that I need to make and logging in for each will take a decade. For example a flow looks like : Log In->Push some component->add some values->Generate a report. Than after this i would like to generate other report on another component but when I try to it gives a null pointer exception. Any ideas? :)