I have a set of automations that work fantastically in Firefox and Chrome, and I\'d like to launch an instance of IEDriver as well.
I\'ve set up IEDriver as per Sel
Faced similar exception while trying to execute Selenium script over BrowserStack for mobile devices. And often found this exception being thrown. Eventually realized being virtual machines involved, emulators were taking time to boot up and thus causing UnreachableBrowserException.
Wrote below code to handle this, by setting Number of times to retry(RetryCount) and made multiple attempts(retryAttempt) to check Remote WebDriver's availability.
while(retryAttempt<=retryCount){
try{
WebDriver driver = new RemoteWebDriver(new URL(URL), caps);
return driver;
}
catch(UnreachableBrowserException e){
Thread.sleep(10000);
if(retryAttempt>retryCount){
logger.error("Remote Web Driver cannot be reached at this moment");
}
}
}