private static boolean isBrowserDead ( ) { try { if ( ( ( FramesTransparentWebDriver ) getDriver ( ) ) . getWrappedDriver ( ) instanceof AppiumDriver ) { getDriver ( ) . getPageSource ( ) ; } else { getDriver ( ) . getCurrentUrl ( ) ; } return false ; } catch ( Throwable t ) { Report . jenkins ( "*****BROWSER IS DEAD ERROR***** " , t ) ; return true ; } }
Checks whether browser is dead . Used to catch situations like Error communicating with the remote browser . It may have died . exceptions