UnreachableBrowserException trying to launch in Selenium Webdriver using IEDriver - java

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 Selenium's Google Code wiki, with the correct path (if I change the path I get a different exception, so it's definitely correct). But for some reason it still can't launch, and just times out.
The code to launch it (the last line throws the exception):
File ieDriver = new File("C:/Users/whatever/path/IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", ieDriver.getAbsolutePath());
WebDriver ie = new InternetExplorerDriver();
And the exception is:
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.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_21'
Driver info: driver.version: InternetExplorerDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:216)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:201)
at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:184)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:174)
at org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:143)
at uk.co.know.kiteTest.WebDriverManager.<init>(WebDriverManager.java:52)
at uk.co.know.kiteTest.RunAutomations.main(RunAutomations.java:13)
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '2.33.0', revision: '4ecaf82108b2a6cc6f006aae81961236eba93358', time: '2013-05-22 12:00:17'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_21'
Driver info: driver.version: InternetExplorerDriver
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:165)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:62)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:527)
... 7 more
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:38622/status] to be available after 20014 ms
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:104)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:163)
... 9 more
Caused by: com.google.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:79)
... 10 more

I was hitting this same error and then found this question. In my case, it turned out that I had the 64 bit version of the IEDriver.exe on my system, but I was on a 32 bit windows platform. So this error was indicating that the OS failed to execute the driver program. I tried to run the driver directly in a command prompt to see that infact the 32 bit OS was not recognizing the 64 bit driver exe as an executable program.
Getting the correct 32 bit IEDriver.exe solved my problem.

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

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");
}
}
}

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);

If you are getting the this exception just download new chrome driver and provide the in your project. That's it. Worked for me :)

Related

WebDriverException: Timed out waiting for driver server to start error with Selenium Edge Chromium through Java

I am getting the below error while trying to run selenium using java in Edge Chromium browser
org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.
Build info: version: '4.0.0-alpha-5', revision: 'b3a0d621cc'
System info: os.version: '10.0', java.version: '1.8.0_271'
Driver info: driver.version: EdgeDriver
Code which I am trying
String edgeDriverPath = propertiesOperations.getPropertyValues("edge_driver_path");
String path = System.getProperty("user.dir");
System.setProperty("webdriver.edge.driver", path + edgeDriverPath);
EdgeOptions options = new EdgeOptions();
options.addArguments("headless");
options.addArguments("disable-gpu");
driver = new EdgeDriver(options);
The same error happened to me when I had the driver in a shared folder (not in C drive). I moved the driver to C drive and it solved the problem.
It took too much time to run/execute the driver if it is located in a shared drive, so it caused time out error.

selenium webDriver (Firefox) : connection refused [duplicate]

Recently I upgraded to Selenium 3.7.
Code:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public static void main (String args[]){
System.setProperty("webdriver.gecko.driver",
"/usr/local/bin/geckodriver");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
driver.quit();
}
Included Library:
selenium-java-3.7.1/selenium-server-standalone-3.7.1.jar
selenium-java-3.7.1/libs/httpcore-4.4.6.jar
selenium-java-3.7.1/libs/httpclient-4.5.3.jar
selenium-java-3.7.1/libs/guava-23.0.jar
selenium-java-3.7.1/libs/gson-2.8.2.jar
selenium-java-3.7.1/libs/commons-logging-1.2.jar
selenium-java-3.7.1/libs/commons-exec-1.3.jar
selenium-java-3.7.1/libs/commons-codec-1.10.jar
selenium-java-3.7.1/libs/byte-buddy-1.7.5.jar
selenium-java-3.7.1/client-combined-3.7.1.jar
selenium-java-3.7.1/client-combined-3.7.1-sources.jar
System environment:
Firefox 56.0.2
Java 1.8
selenium-java-3.7.1
selenium-server-standalone-3.7.1
geckodriver - v0.19.1
Error trace log:
Usage:
/usr/local/bin/geckodriver [OPTIONS] /usr/local/bin/geckodriver:
Unknown option --port=8970 Exception in thread "main"
org.openqa.selenium.WebDriverException:
org.apache.http.conn.HttpHostConnectException: Connect to
localhost:8970 [localhost/0:0:0:0:0:0:0:1,
localhost/fe80:0:0:0:0:0:0:1%1] failed: Connection refused (Connection
refused) Build info: version: '3.7.1', revision: '8a0099a', time:
'2017-11-06T21:07:36.161Z' System info: host:
'Maggies-MacBook-Pro-2.local', ip: '192.168.1.6', os.name: 'Mac OS X',
os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver
Any idea would be appreciated. Thank you.
Update after trying Debanjan suggestion:
Code:
public static void main (String args[]){
System.out.println("Debug 1");
System.setProperty("webdriver.gecko.driver",
"/Users/maggie/Documents/ToolsQA/Libs/geckodriver");
System.out.println("Debug 2");
WebDriver driver = new FirefoxDriver();
System.out.println("Debug 3");
driver.get("http://www.google.com");
driver.quit();
}
Include Library:
selenium-server-standalone-3.7.1.jar
System Environment:
Firefox 56.0.2
Java 1.8
selenium-java-3.7.1
selenium-server-standalone-3.7.1
geckodriver 0.19.1
Mac OS X', os.arch: 'x86_64', os.version: '10.12.6'
Error trace log:
Debug 1 Debug 2 Starting ChromeDriver 2.33.506106
(8a06c39c4582fbfbab6966dbb1c38a9173bfb1a2) on port 2198 Only local
connections are allowed. Exception in thread "main"
org.openqa.selenium.WebDriverException: Timed out waiting for driver
server to start. Build info: version: '3.7.1', revision: '8a0099a',
time: '2017-11-06T21:07:36.161Z' System info: host:
'Maggies-MacBook-Pro-2.local', ip: '192.168.1.6', os.name: 'Mac OS X',
os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver at
org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:192)
at
org.openqa.selenium.remote.service.DriverService.start(DriverService.java:178)
at
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at
org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:181)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:168)
at
org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:123)
at AutomationFrameWork.FirstTestCase.main(FirstTestCase.java:13)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed
out waiting for [http://localhost:2198/status] to be available after
20005 ms at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100)
at
org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:187)
... 9 more Caused by: java.util.concurrent.TimeoutException at
java.util.concurrent.FutureTask.get(FutureTask.java:205) at
com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:147)
at
org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75)
... 10 more
The error WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8970 can occur due to different reasons.
More over there is a discrepency in your Included Library list as selenium-server-standalone-3.7.1.jar is never a part of downloaded selenium-java-3.7.1.zip.
Try out the steps mentioned below:
From the Included Library list remove all the jars.
Download and Add only selenium-server-standalone-3.7.1.jar from this link or from this link
Ensure that /etc/hosts on your system contains the following entry :
1 127.0.0.1 localhost.localdomain localhost
Run CCleaner Tool to wipe away all the OS chores from your system.
You can opt for a System Reboot.
Execute your Test.
I tried with the same versions without any problem.
If the path to the geckodriver:
System.setProperty("webdriver.gecko.driver",
"/usr/local/bin/geckodriver");
is correct, make sure that the geckodriver is executable for the user that execute the code:
chmod +x geckodriver
After doing some research, I manage to resolve this problem.
The error is due to the 127.0.0.1 map to localhost.com in etc/hosts.
Edited:
127.0.0.1 localhost
I think you are missing the .exe extension. Your path should be like this
System.setProperty("webdriver.gecko.driver",
"/usr/local/bin/geckodriver.exe");

How to resolve " org.openqa.selenium.WebDriverException: java.net.ConnectException: Failed to connect to localhost/" with google driver?

I am facing above mentioned issue since 1 week. Earlier it was working smoothly. Even now sometimes it works fine but most of the time I am getting "Failed to connect to localhost/" error. :(
I have upgraded chrome driver to 2.37 now downgraded it again to 2.36 but no luck. :( Thanks.
Issue details:
java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:4321
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: host: 'GURWUNknjk', ip: '10.202.126.154', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
Here is code for your reference:
Note : It works fine till login. Issue comes only when I try to search some element after login.
public static WebDriver driver;
public static void main(String[] args) throws InterruptedException, IOException {
System.setProperty("webdriver.chrome.driver", "d://chromedriver.exe");
driver = new ChromeDriver();
String url = "https://accounts.google.com/signin/v2/identifier?continue=https%3A%2F%2Faccounts.google.com%2Fb%2F0%2FAddMailService&flowName=GlifWebSignIn&flowEntry=AddSession";
driver.get(url);
driver.manage().window().maximize();
WebDriverWait wait = new WebDriverWait(driver, 20);
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS) ;
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='Email']")));
if(driver.getCurrentUrl().contains("https://accounts.google.com/signin/v2/identifier?"))
{
driver.findElement(By.id("identifierId")).sendKeys(username);
driver.findElement(By.id("identifierNext")).click(); wait.until(ExpectedConditions.presenceOfElementLocated(By.name("password")));
driver.findElement(By.name("password")).sendKeys(pwd);
driver.findElement(By.name("password")).sendKeys(Keys.ENTER);
}
else{
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='Email']")));
driver.findElement(By.name("Email")).sendKeys(UserName);
driver.findElement(By.id("next")).click(); wait.until(ExpectedConditions.presenceOfElementLocated(By.name("Passwd")));
driver.findElement(By.name("Passwd")).sendKeys(Pwd);
wait.until(ExpectedConditions.presenceOfElementLocated(By.name("signIn")));
driver.findElement(By.id("signIn")).click();
}
wait.until(ExpectedConditions
.visibilityOfElementLocated(By.id(element id)));
driver.findElement(By.id(element id))
.sendKeys(some value);
Thread.sleep(3000);
driver.findElement(By.id(element id)).click(); }
The error says it all :
java.net.ConnectException: Failed to connect to localhost/0:0:0:0:0:0:0:1:4321
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:33:15.31Z'
System info: host: 'GURWUNknjk', ip: '10.202.126.154', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_131'
Driver info: driver.version: RemoteWebDriver
The error clearly shows that the ChromeDriver was not recognized as in :
Driver info: driver.version: RemoteWebDriver
Your main issue is the version compatibility between the binaries you are using as follows :
You are using chromedriver=2.37
Your chrome version is unknown to us.
Your Selenium Client version is 3.11.0.
Your JDK version is 1.8.0_131 which is pretty ancient.
So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.11.0 , ChromeDriver version (v2.37).
Solution
Upgrade JDK to recent levels JDK 8u162.
Keep ChromeDriver at current ChromeDriver v2.37 level.
Keep Chrome version at Chrome v65.x levels. (as per ChromeDriver v2.37 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test.
Take a look at where you are instantiating the drive.
You wrote: System.setProperty("webdriver.chrome.driver", "d://chromedriver.exe");
I believe the issue is with the chrome drive path.
Try: "D:/chromedriver.exe");
There should be only one forward slash when defining the path.

Selenium RemoteWebDriver UnreachableBrowserException with Edge

Hi I've been working on a side-project using Maven and a TestNG Framework. So far my code works well with WebDriver instances (Chrome, Firefox, Edge), but I keep getting errors when attempting to set up a RemoteWebDriver with Edge. Here is how I have my Driver class(Implementing WebDriver Class) set up: (Showing the constructor portion with initializing Driver through RemoteWebDriver:
Edits:
public Driver (String browserName) {
this.browserName = browserName;
....
if(browserName.equalsIgnoreCase("edge")) {
System.setProperty("webdriver.edge.driver","./resources/webdrivers/MicrosoftWebDriver.exe");
DesiredCapabilities browser = DesiredCapabilities.edge();
browser.setPlatform(Platform.WIN10);
try {
this.driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), browser);
} catch (MalformedURLException e) {
e.printStackTrace();
}
js = (JavascriptExecutor) driver;
bugCapture = (TakesScreenshot)driver;
testFailDir = newFailCapDir();
}
When running the code with mvn and setting -Dbrowser=edge, this is the error I receive:
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: '3.7.1', revision: '8a0099a', time: '2017-11-
06T21:01:39.354Z'
System info: host: 'LAPTOP-L1BFDSGL', ip: '10.0.0.11', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_162'
Driver info: driver.version: Driver
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to
localhost:17556 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed:
Connection refused: connect
Caused by: java.net.ConnectException: Connection refused: connect
After some research, I thought the problem was that I didn't have the Selenium-server-standalone jar file, it seems to call on the Maven Dependencies of Selenium jar files. I've looked around on this site and others to find the solution to my problem, but I'm still getting the same error. Is there a file I'm missing or can RemoteWebDriver be applied with Edge driver?
Any advice would help in this situation.
Thanks.
Update
#DebanjanB's request, The hub I used was during the declaration. After some research I didn't realize that I didn't have to have a hub or node active. (Probably why I was getting unreachable exception.) I also checked that I could set up a hub and node(I used port -5555 for node role). Commands I used for Hub and Node in separate cmd prompts:
java -jar selenium-server-standalone-3.10.0.jar -role hub
java -jar selenium-server-standalone-3.10.0.jar -role node -hub
http://localhost:4444/grid/register -port 5555
I also updated my maven dependencies to include to Selenium server standalone.
The maven I was running for my test was:
mvn test -Dbrowser=edge -Dgroups=<specified group>
When I ran with the hub running I was getting this exception error:
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: '3.10.0', revision: '176b4a9', time: '2018-03-
02T19:03:16.397Z'
System info: host: 'LAPTOP-L1BFDSGL', ip: '10.0.0.11', os.name: 'Windows
10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_162'
Driver info: driver.version: Driver
Caused by: java.net.ConnectException: Failed to connect to /10.0.0.11:4444
Caused by: java.net.ConnectException: Connection refused: connect
Before the failure I saw this message:
Mar 09, 2018 7:05:25 PM org.openqa.selenium.remote.DesiredCapabilities
edge
INFO: Using new EdgeOptions() is preferred to
DesiredCapabilities.edge()
//Error about test cases failed and skipped
#DebanjanB let me know if you need more clarification.
Update:
I managed to get my Remote Webdriver working using Edge. I had to mention the Dwebdriver I was going to use when registering my Node after setting up my hub.
Registering my Node:
java -Dwebdriver.edge.driver=MicrosoftWebDriver.exe -jar selenium-server-standalone-3.10.0.jar -role node -hub http://localhost:4444/grid/register -port 5555
(And I had add the physical driver as well for the path since when running on local drivers, I placed them in a different path.)
In my Driver class (I had to set my URL to my node instead of my hub):
System.setProperty("webdriver.edge.driver","./resources/webdrivers/MicrosoftWebDriver.exe");
DesiredCapabilities browser = DesiredCapabilities.edge();
try {
driver = new RemoteWebDriver(new URL("http://10.0.0.19:5555/wd/hub"), browser);
} catch (MalformedURLException e) {
e.printStackTrace();
}
Now when I run the command for edge without issue. :)
The error gives us some hint as follows :
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.
The error seems to be coming out of the line :
browser.setBrowserName(DesiredCapabilities.edge().getBrowserName());
As per your code block, browser is an instance of DesiredCapabilities Class and as per the documentation of setBrowserName() method it is defined as :
public void setBrowserName(java.lang.String browserName)
The edge() method from DesiredCapabilities Class helps us to cast the DesiredCapabilities object but doesn't contain any method e.g. getBrowserName() as such. So the following expression raises an error :
DesiredCapabilities.edge().getBrowserName()
As per the current release of Selenium v3.10.0, casting the DesiredCapabilities object with either chrome(), firefox(), internetExplorer() or edge() would automatically set the BrowserName and won't be needed to be explicitly mentioned.
Update
You need to send proper commands to start the Selenium Grid Hub and Selenium Grid Node.
For the error you are seeing org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session check the discussion RemoteWebDriver throws “org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session”
For a complete workflow check the discussion IE11 test runs if specified direct node ip but fails when grid hub url specified

Chromedriver failing on Jenkins (Linux)

I am trying to run UI tests on Chrome on Jenkins, and from the error it appears that it is failing to start.
org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf),platform=Linux 2.6.32-358.el6.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.54 seconds (user: 'UnknownUser-0', output: '1440016601647')
Build info: version: '2.45.0', revision: '5017cb8e7ca8e37638dc3091b2440b90a1d8686f', time: '2015-02-27 09:10:26'
System info: host: 'abc.xyz.com', ip: '111.222.333.444', os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.32-358.el6.x86_64', java.version: '1.8.0_05'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:171)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:139)...
The code (in Java) simply tries to instantiate a default instance of Chromedriver, and fails. The following message also shows in the log, which confuses me. It appears that the driver is opening, but stopping immediately?
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 4601
Only local connections are allowed.
[0.422][WARNING]: PAC support disabled because there is no system implementation
Starting ChromeDriver 2.14.313457 (3d645c400edf2e2c500566c9aa096063e707c9cf) on port 9515
Only local connections are allowed.
The instantiation is done as:
WebDriver webDriver = null;
String chromeDriverLocation = MyCustomPropertyReader.getProperty("webdriver.chrome.binary.location");
System.setProperty("webdriver.chrome.driver", chromeDriverLocation);
final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
webDriver = new ChromeDriver(capabilities);
I am able to run the Chromedriver from the command prompt, and I have also checked that all the environment variables that are needed to load it up and indeed available during the instantiation.
Could someone tell me what I might be missing, or if there is a way to obtain more information about the cause of this failure?
The issue was resolved by updating the browser installation, and making sure that both Chromedriver and the Chrome browser can be run from the command prompt.

Categories

Resources