ChromeWebDriver - unknown error: Chrome failed to start: crashed

前端 未结 10 2022
一整个雨季
一整个雨季 2020-11-29 11:00

I\'m trying to test my application on Chrome with ChromeWebDriver but every time I try I get following exception:

   org.openqa.selenium.WebDriverException:          


        
相关标签:
10条回答
  • 2020-11-29 11:32

    I had the same problem as above. Turned out I somehow managed to have two chrome.exe installed. One under Program Files and on under user\appdata\local..... I uninstall the one under Program Files and now it works like a charm.

    0 讨论(0)
  • 2020-11-29 11:32

    If you are unable to start your browser in selenium. please ensure whether you set chrome browser as defualt? bcz of this also u may face this "Failed to start your browser" ERROR

    0 讨论(0)
  • 2020-11-29 11:34

    I was able to resolve this issue on Windows 10 by using the Administrator CMD to run my scripts.

    0 讨论(0)
  • 2020-11-29 11:38

    I have also faced the same issue. I did nothing . I have waited for some 15 mins and run my scripts again. It got worked.

    0 讨论(0)
  • 2020-11-29 11:39
      DesiredCapabilities capability = DesiredCapabilities.chrome();
    
            System.setProperty("webdriver.chrome.driver", "path to chromedriver.exe");
            capability.setBrowserName("chrome");
            capability.setPlatform(PlatformAndEnvironmentSetUp.platformSetUp);
    
            driver = new RemoteWebDriver(new URL("http://" + PlatformAndEnvironmentSetUp.hubIP + ":" + PlatformAndEnvironmentSetUp.hubPort + "/wd/hub"), capability);
    
    
            this.driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
            this.driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
            this.driver.manage().window().setSize(new Dimension(1920, 1080));
    //page instances init()
    
            loginPage = PageFactory.initElements(this.driver, LoginPage.class);
            homePage = PageFactory.initElements(this.driver, AdminHomePage.class);
    

    This sample code works OK for me. Just a little note: "chromedriver.exe" I'm placing in the same project folder. That makes the question of path to chromdriver executable easier.

    So this line of code looks in this way:

    System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
    

    Resource to download chromedriver.exe

    Hope this helps you.

    0 讨论(0)
  • 2020-11-29 11:41

    I fixed this on Windows 10 by setting chromedriver.exe, [yourPythonIDE].exe, and chrome.exe to run with Administrator rights, which can reached via right-clicking the exe file and going to Properties >> Compatibility.

    0 讨论(0)
提交回复
热议问题