java.lang.IllegalStateException: The driver executable does not exist: C:\Users\jagrelot\workspace\AntBuildExample\chromedriver.exe with ChromeDriver

后端 未结 1 1660
别跟我提以往
别跟我提以往 2020-12-21 13:46

When I try to run Selenium within Eclipse, I get a The driver executable does not exist: error. I\'ve ensured that the path to the exe is correct and that the environment PA

相关标签:
1条回答
  • 2020-12-21 14:50

    The code block you have provided is not sufficient to analyze the root cause. How ever the following points are pretty much evident :

    1. The initialization of ChromeDriver is error prone, it should have been :

      ChromeDriver driver = new ChromeDriver();
      
    2. As per best practices we should use the WebDriver interface instead of the ChromeDriver implementation :

      WebDriver driver = new ChromeDriver();
      
    3. As you are seeing the error as IllegalStateException: The driver executable does not exist: C:\Users\jagrelot\workspace\AntBuildExample\chromedriver.exe which clearly indicates your script is looking for the chromedriver binary in a different location other than the mentioned one. Probably its due to error prone code of setProperty.

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