This is going to be real PITA if you use -
Public static Webdriver driverProblem is the word "static" For the obvious reasons you already mentioned.
If you run your tests in parallel using testng and have two different tests each instantiating firefox and ie then
the one which instantiates after is going to change the state of first instantiation of driver object.
like this -
first driver object of FF driver is created
now same driver object becomes the ie driver (since it is marked as static hence it can have only one value)
Now old ff driver which has become ie driver tries to run your tests in FF browser and gives up.
So you could safely use -
protected Webdriver driverand parallel execution of test will not have such issues.
~ seleniumtests.com