• <legend id='pLprS'><style id='pLprS'><dir id='pLprS'><q id='pLprS'></q></dir></style></legend>

    <tfoot id='pLprS'></tfoot>

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

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

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

        ChromeDriver:自定义 Chrome 可执行文件路径

        时间:2023-09-28
      1. <i id='ijfWC'><tr id='ijfWC'><dt id='ijfWC'><q id='ijfWC'><span id='ijfWC'><b id='ijfWC'><form id='ijfWC'><ins id='ijfWC'></ins><ul id='ijfWC'></ul><sub id='ijfWC'></sub></form><legend id='ijfWC'></legend><bdo id='ijfWC'><pre id='ijfWC'><center id='ijfWC'></center></pre></bdo></b><th id='ijfWC'></th></span></q></dt></tr></i><div id='ijfWC'><tfoot id='ijfWC'></tfoot><dl id='ijfWC'><fieldset id='ijfWC'></fieldset></dl></div>

          <tbody id='ijfWC'></tbody>
      2. <legend id='ijfWC'><style id='ijfWC'><dir id='ijfWC'><q id='ijfWC'></q></dir></style></legend>

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

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

              <tfoot id='ijfWC'></tfoot>

                • 本文介绍了ChromeDriver:自定义 Chrome 可执行文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用的是便携版的谷歌浏览器.

                  I'm using the portable version of Google Chrome.

                  由于 WebDriver 需要默认安​​装路径,它没有找到明显在另一个位置的便携式:

                  Since WebDriver expects the default installation path, it does not find the portable one which obviously is at another location:

                  Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
                    (Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
                  Command duration or timeout: 11.13 seconds
                  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.8.0_05'
                  Driver info: org.openqa.selenium.chrome.ChromeDriver
                  

                  如何设置 chrome.exe 文件的自定义路径?

                  How do I set a custom path to the chrome.exe file?

                  推荐答案

                  没关系,我自己找到了答案:

                  Nevermind, I found the answer myself:

                  ChromeOptions options = new ChromeOptions();
                  options.setBinary("/path/to/chrome/binary");
                  
                  ChromeDriver driver = new ChromeDriver(options);
                  

                  Chromedriver 文档

                  这篇关于ChromeDriver:自定义 Chrome 可执行文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:将选项传递给 chrome 驱动程序 selenium 下一篇:如何通过除“类"之外的属性直接找到 WebEle

                  相关文章

                  最新文章

                  • <bdo id='DYhyD'></bdo><ul id='DYhyD'></ul>
                • <small id='DYhyD'></small><noframes id='DYhyD'>

                  <tfoot id='DYhyD'></tfoot>

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