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

    • <bdo id='mQVJG'></bdo><ul id='mQVJG'></ul>
  • <tfoot id='mQVJG'></tfoot>

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

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

        如何在 Windows 10 上安装 ChromeDriver 并使用 Chrome 运

        时间:2023-10-08

            <tbody id='wv2S6'></tbody>
          1. <small id='wv2S6'></small><noframes id='wv2S6'>

              <tfoot id='wv2S6'></tfoot>

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

                1. 本文介绍了如何在 Windows 10 上安装 ChromeDriver 并使用 Chrome 运行 Selenium 测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我们有一个 Ubuntu 服务器,用于在 Chrome 和 Firefox 上运行 Selenium 测试(我安装了 ChromeDriver),我还想在我的 Windows 10 计算机上本地运行测试.我想保持两台计算机的 Python 代码相同.但我没有找到如何在 Windows 10 上安装 ChromeDriver?我在文档中没有找到它 [1, 2].

                  We have an Ubuntu server which we use for running Selenium tests with Chrome and Firefox (I installed ChromeDriver) and I also want to run the tests locally on my Windows 10 computer. I want to keep the Python code the same for both computers. But I didn't find out how to install the ChromeDriver on Windows 10? I didn't find it on the documentation [1, 2].

                  这是在 Chrome 中运行测试的代码:

                  Here is the code that runs the test in Chrome:

                  import unittest
                  from selenium import webdriver
                  
                  class BaseSeleniumTestCase(unittest.TestCase):
                      ...
                      ...
                      ...
                      ...
                  
                      def start_selenium_webdriver(self, chrome_options=None):
                          ...
                          self.driver = webdriver.Chrome(chrome_options=chrome_options)
                          ...
                  

                  我还发现了 如何在中运行 Selenium WebDriver 测试用例Chrome?但它似乎不在Python中(没有标记任何编程语言,它是什么?)

                  I also found How to run Selenium WebDriver test cases in Chrome? but it seems to be not in Python (no programming language is tagged, what is it?)

                  更新 #1: 我在 https://sites.google.com/a/chromium.org/chromedriver/getting-started,但是如果我想为两者保留相同的 Python 代码,我应该将文件放在 Windows 10 的哪个位置电脑?

                  Update #1: I found some Python code in https://sites.google.com/a/chromium.org/chromedriver/getting-started, but where do I put the file in Windows 10 if I want to keep the same Python code for both computers?

                  更新 #2: 我下载了 chromedriver.exe 并将其放在 C:Windows 中,它可以工作,但我没有看到它记录在任何地方.

                  Update #2: I downloaded and put chromedriver.exe in C:Windows and it works, but I didn't see it documented anywhere.

                  推荐答案

                  正如 Uri 在问题中所说,在 Update #2 下,下载最新版本的 chromedriver 并将其放置在 C:Windows纠正问题.

                  As Uri stated in the question, under Update #2, downloading the latest release of chromedriver and placing it in C:Windows corrects the issue.

                  当浏览器窗口打开(以及命令提示符窗口)时,Chrome 挂起时遇到了同样的问题.

                  I had the same issue with Chrome hanging when the browser window opens (alongside a command prompt window).

                  可以在以下位置找到最新的驱动程序:

                  The latest drivers can be found at:

                  https://sites.google.com/a/chromium.org/chromedriver/下载

                  chromedriver_win32.zip 文件中的版本在我的 64 位系统上运行.

                  The version in the chromedriver_win32.zip file is working on my 64-bit system.

                  这篇关于如何在 Windows 10 上安装 ChromeDriver 并使用 Chrome 运行 Selenium 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Python 和 Selenium WebDriver 获取 localStorag 下一篇:如何在 pyinstaller 中包含 chromedriver?

                  相关文章

                  最新文章

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

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

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