java - How to verify whether a browser exists in selenium webdriver -


i using webdriver open firefox browser , iteratively pass url using spreadsheet (that contains 5 urls in different cells of column 1). if suppose manually close firefox browser after 2 urls opened. want script handle situation , continue execution tried below 3 conditions, everytime null pointer exception. please suggest how handle situation.

if (driver.tostring().contains("null")) if (driver.gettitle().contains("null"))  if (driver.getcurrenturl().contains("null"))  

there no inbuilt method can use workaround

/**  *   * @return true if driver alive else false  */ public boolean isalive() {     try {         driver.getcurrenturl();//or driver.gettitle();         return true;     } catch (exception ex) {         return false;     } } 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -