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
It seems to me you use improper driver initilization. Try piece of code from my project:
File file = new File("C:/Selenium/iexploredriver.exe");
System.setProperty("webdriver.ie.driver", file.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver();
I had the same issue. This fixed it for me:
DesiredCapabilities capabilitiesIE = DesiredCapabilities.internetExplorer();
capabilitiesIE.setCapability(
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
WebDriver driver = new InternetExplorerDriver(capabilitiesIE);
Selenium WebDriver with Chrome, issue:
(org.openqa.selenium.remote.UnreachableBrowserException) solution
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.35.0', revision: '8df0c6b', time: '2013-08-12 15:43:19'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_40'
Driver info: driver.version: ChromeDriver
If you are getting above problem, go to the chromedriver.exe
location and try to execute the exe. If you are able to execute the exe then below code will work. Otherwise it will be a permission issue to the chromedriver folder. Change the folder location or provide the permission to the folder and double click on chromedriver.exe.
Solution:
System.setProperty("webdriver.chrome.driver", "C:/Driver/chromedriver.exe");
System.out.println(System.getProperty("webdriver.chrome.driver"));
WebDriver driver3 = new ChromeDriver();
Go to hosts (C:\Windows\system32\drivers\etc) and make sure that you have this line correctly: 127.0.0.1 localhost
If you are getting the this exception just download new chrome driver and provide the in your project. That's it. Worked for me :)
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");
}
}
}