How to install ChromeDriver on Windows 10 and run Selenium tests with Chrome?

We have a Ubuntu server that we use to run Selenium tests with Chrome and Firefox (I installed ChromeDriver), and also want to run tests locally on my Windows 10 computer. I want the Python code to be the same for both computers. But I did not find out how to install ChromeDriver on Windows 10? I did not find it in the documentation [1 , 2] .

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) ... 

I also found How to run Selenium WebDriver test cases in Chrome? but it doesn't seem to be in Python (the programming language is not marked, what is it?)

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

Update # 2: I downloaded and placed chromedriver.exe in C:\Windows and it works, but I haven’t seen anything documented anywhere.

+5
source share
2 answers

As Uri said in the question, in the Update # 2 section, downloading the latest version of chrome and placing it in C: \ Windows fixes the problem.

I had the same issue with Chrome freezing when a browser window opens (next to the command prompt window).

The latest drivers can be found at:

https://sites.google.com/a/chromium.org/chromedriver/downloads

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

+8
source

Let me first state the requirements. Here you can download the chromed zip web driver. https://chromedriver.storage.googleapis.com/index.html?path=2.33/

Extract the file and save it in the right place.

Create a new project in Eclipse and include the following code in your class.

 System.setProperty("webdriver.chrome.driver", "C:\\temp\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); 

Explanation: System.setProperty(key,value) :

The default key is the same for all systems, the value is the location of your file to remove chrome edges.

+2
source

Source: https://habr.com/ru/post/1233791/


All Articles