<i id='sdLJB'><tr id='sdLJB'><dt id='sdLJB'><q id='sdLJB'><span id='sdLJB'><b id='sdLJB'><form id='sdLJB'><ins id='sdLJB'></ins><ul id='sdLJB'></ul><sub id='sdLJB'></sub></form><legend id='sdLJB'></legend><bdo id='sdLJB'><pre id='sdLJB'><center id='sdLJB'></center></pre></bdo></b><th id='sdLJB'></th></span></q></dt></tr></i><div id='sdLJB'><tfoot id='sdLJB'></tfoot><dl id='sdLJB'><fieldset id='sdLJB'></fieldset></dl></div>
          <bdo id='sdLJB'></bdo><ul id='sdLJB'></ul>

        <small id='sdLJB'></small><noframes id='sdLJB'>

        <tfoot id='sdLJB'></tfoot>
      1. <legend id='sdLJB'><style id='sdLJB'><dir id='sdLJB'><q id='sdLJB'></q></dir></style></legend>

        java.lang.IllegalStateException:驱动程序可执行文件不存

        时间:2023-09-28

          • <bdo id='ht4b6'></bdo><ul id='ht4b6'></ul>
              <tbody id='ht4b6'></tbody>

            <small id='ht4b6'></small><noframes id='ht4b6'>

            1. <legend id='ht4b6'><style id='ht4b6'><dir id='ht4b6'><q id='ht4b6'></q></dir></style></legend>
                • <tfoot id='ht4b6'></tfoot>
                • <i id='ht4b6'><tr id='ht4b6'><dt id='ht4b6'><q id='ht4b6'><span id='ht4b6'><b id='ht4b6'><form id='ht4b6'><ins id='ht4b6'></ins><ul id='ht4b6'></ul><sub id='ht4b6'></sub></form><legend id='ht4b6'></legend><bdo id='ht4b6'><pre id='ht4b6'><center id='ht4b6'></center></pre></bdo></b><th id='ht4b6'></th></span></q></dt></tr></i><div id='ht4b6'><tfoot id='ht4b6'></tfoot><dl id='ht4b6'><fieldset id='ht4b6'></fieldset></dl></div>
                  本文介绍了java.lang.IllegalStateException:驱动程序可执行文件不存在:C:UsersjagrelotworkspaceAntBuildExamplechromedriver.exe with ChromeDriver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  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 PATH variable is set. The error is referencing an older location of the driver which was located in the workspace of the Java project. It seems to be working when I run it through the command line. Are there any suggestions to get the code to run in Eclipse properly?

                  public WebDriver chromeDriver;
                  
                  @BeforeTest
                  public void beforeTestsetUp(){
                  
                      System.setProperty("webdriver.chrome.driver", "C:\Driver\chromedriver.exe");
                      chromeDriver = new ChromeDriver();
                  
                  
                      [RemoteTestNG] detected TestNG version 6.12.0
                      FAILED CONFIGURATION: @BeforeTest beforeTestsetUp
                      java.lang.IllegalStateException: The driver executable does not exist: C:UsersjagrelotworkspaceAntBuildExamplechromedriver.exe
                  

                  解决方案

                  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:UsersjagrelotworkspaceAntBuildExamplechromedriver.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.

                  这篇关于java.lang.IllegalStateException:驱动程序可执行文件不存在:C:UsersjagrelotworkspaceAntBuildExamplechromedriver.exe with ChromeDriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 下一篇:如何使用 Java 获取 chromedriver 进程 PID?

                  相关文章

                  最新文章

                  <legend id='fUOw5'><style id='fUOw5'><dir id='fUOw5'><q id='fUOw5'></q></dir></style></legend>
                  <i id='fUOw5'><tr id='fUOw5'><dt id='fUOw5'><q id='fUOw5'><span id='fUOw5'><b id='fUOw5'><form id='fUOw5'><ins id='fUOw5'></ins><ul id='fUOw5'></ul><sub id='fUOw5'></sub></form><legend id='fUOw5'></legend><bdo id='fUOw5'><pre id='fUOw5'><center id='fUOw5'></center></pre></bdo></b><th id='fUOw5'></th></span></q></dt></tr></i><div id='fUOw5'><tfoot id='fUOw5'></tfoot><dl id='fUOw5'><fieldset id='fUOw5'></fieldset></dl></div>

                      <bdo id='fUOw5'></bdo><ul id='fUOw5'></ul>

                    <tfoot id='fUOw5'></tfoot>

                  1. <small id='fUOw5'></small><noframes id='fUOw5'>