However, I was hoping that it might be inspiration to get some folks thinking about solving this issue in a more robust way. If the Chrome browser is updated, then you need to download the new Chrome driver from the above link, because it would be compatible with the new browser version. This solution is far from ideal as it depends on the release notes being formatted a specific way and hosted at specific URLs, so I'd be hesitant to say this exact solution is what should be implemented. You can find the repo for this Node module here. I then pass this value to the webdriver-manager update command so that the correct ChromeDriver version is installed. To get around the issue, I wrote a Node module that retrieves the local version of Chrome as well as the release notes for ChromeDriver, then parses the release notes and finds the version of ChromeDriver that's compatible with the installed version of Chrome. It would be great if webdriver-manager update had an option to install the ChromeDriver version that is compatible with the locally-installed version of Chrome so there's never a mismatch. As a result, the latest release of ChromeDriver was installed on a machine that had Chrome 68 installed, but the latest ChromeDriver is only compatible with Chrome 69+ and therefore caused the build to fail. However, we don't have full control over the version of Chrome on the machine where the tests are running, whether that's a hosted build agent in Microsoft VSTS or on an individual developer's machine. On my project, we have an automated build system that runs webdriver-manager update before running Selenium-based browser tests in Chrome so that the appropriate ChromeDriver bits are installed. With webdriver manager, you just need to do two simple steps: Install manager: pip install webdriver-manager Use with Chrome selenium 3 from selenium import webdriver from webdrivermanager.chrome import ChromeDriverManager driver webdriver.Chrome(ChromeDriverManager(). A project I work on recently got bitten by a version mismatch between ChromeDriver and the locally-installed version of Chrome.
0 Comments
Leave a Reply. |