刚设定
driver=null;
每次您退出浏览器并检查
if (browser!=null){ //Attention: this comand is not supported //as far as i know ;) driver.doSomething();}要么
try{}catch (NullPointerException e) e.printStackTrace(); System.err.print"DAMN";}或收到NullPointerException;)



