0
votes

I am using Eclipse Luna with windows 10-64 bit, selenium-server-standalone-3.141.59 and selenium-java-3.141.59.
I have write a simple program to hit the url .But I am getting this error:

[13552:3540:0515/184943.562:ERROR:cache_util_win.cc(21)] Unable to move the cache: 0 [13552:3540:0515/184943.562:ERROR:cache_util.cc(141)] Unable to move cache folder C:\Users\RChauh\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache to C:\Users\RChauh\AppData\Local\Google\Chrome\User Data\ShaderCache\old_GPUCache_000 [13552:3540:0515/184943.562:ERROR:disk_cache.cc(185)] Unable to create cache [13552:3540:0515/184943.562:ERROR:shader_disk_cache.cc(623)] Shader Cache Creation failed: -2 Opening in existing browser session. Exception in thread "main" org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'LAPTOP-3VFBUTNB', ip: '192.168.1.102', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_211' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:202) at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:188) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:79) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131) 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 helloWorld.java.main(java.java:11) Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for [http://localhost:32149/status] to be available after 20016 ms at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:100) at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:197) ... 9 more Caused by: java.util.concurrent.TimeoutException at java.util.concurrent.FutureTask.get(Unknown Source) at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeout(SimpleTimeLimiter.java:156) at org.openqa.selenium.net.UrlChecker.waitUntilAvailable(UrlChecker.java:75) ... 10 more

package helloWorld;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class java {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.setProperty("webdriver.chrome.driver","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe");
        WebDriver driver=new ChromeDriver();
        driver.get("https://www.facebook.com/");
        System.out.println("LoginPage");
        driver.quit();
    }

}
1

1 Answers

1
votes

You should set webdriver.chrome.driver property to point to the chromedriver.exe, not to chrome.exe

  1. Download the relevant ChromeDriver package for your Chrome browser version
  2. Unpack the archive somewhere
  3. Amend the webdriver.chrome.driver property to point to the chromedriver.exe from step 2
  4. That's it, you should be good to go now

Check out ChromeDriver - WebDriver for Chrome -> Getting Started for more detailed information if needed.


Until it's not too late be aware of Page Object design pattern, it is some form of Selenium scripting Best Practice which allows to split test logic from UI elements definitions making your tests easier to develop and especially maintain. Check out Design Patterns - Page Object Model for more detailed information and example test project.