<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Selenium – manager</title><link>https://trunk--polite-jelly-cc0866.netlify.app/tags/manager/</link><description>Recent content in manager on Selenium</description><generator>Hugo -- gohugo.io</generator><lastBuildDate>Mon, 13 Nov 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://trunk--polite-jelly-cc0866.netlify.app/tags/manager/index.xml" rel="self" type="application/rss+xml"/><item><title>Blog: Novelties in Selenium Manager 0.4.15</title><link>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/novelties_in_selenium_manager_0.4.15/</link><pubDate>Mon, 13 Nov 2023 00:00:00 +0000</pubDate><guid>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/novelties_in_selenium_manager_0.4.15/</guid><description>
&lt;h3 id="support-for-firefox-esr">Support for Firefox ESR&lt;/h3>
&lt;p>Selenium Manager 0.4.15 includes support for Firefox Extended Support Release (ESR). This way, Firefox ESR can be automatically managed with Selenium using the label &lt;code>esr&lt;/code> in the browser version. Bindings languages set this browser version (like other accepted labels for browser versions, such as &lt;code>stable,&lt;/code> &lt;code>beta,&lt;/code> &lt;code>dev,&lt;/code> &lt;code>canary,&lt;/code> and &lt;code>nightly&lt;/code>) using a browser option called &lt;a href="https://www.selenium.dev/documentation/webdriver/drivers/options/#browserversion">browserVersion&lt;/a>.&lt;/p>
&lt;h3 id="support-for-edge-webview2">Support for Edge WebView2&lt;/h3>
&lt;p>Selenium Manager 0.4.15 allows automated driver management for &lt;a href="https://developer.microsoft.com/microsoft-edge/webview2">Microsoft Edge WebView2&lt;/a>. WebView2 is a component that enables embedding web technologies (HTML, CSS, and JavaScript) in native apps, using Microsoft Edge as the rendering engine to display web content. At the time of this writing, WebView2 is available in Windows.&lt;/p>
&lt;p>This way, Selenium Manager allows detecting WebView2 in Windows machines and resolving the proper msedgedriver binary for it. Internally, Selenium Manager uses the browser name &lt;code>webview2&lt;/code> to handle WebView2, detecting its version based on &lt;a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#detect-if-a-suitable-webview2-runtime-is-already-installed">registry queries&lt;/a>. In the bindings, WebView2 is enabled through a browser option called &lt;code>useWebView&lt;/code>.&lt;/p>
&lt;h3 id="support-for-mirror-repositories">Support for mirror repositories&lt;/h3>
&lt;p>Selenium Manager 0.4.15 includes a couple of new arguments in Selenium Manager for specifying custom URLs for drivers and browsers (instead of the default ones, such as &lt;a href="https://chromedriver.storage.googleapis.com/">chromedriver&lt;/a>, &lt;a href="https://googlechromelabs.github.io/chrome-for-testing/">Chrome for Testing&lt;/a>, etc.). These arguments are:&lt;/p>
&lt;ul>
&lt;li>&lt;code>--driver-mirror-url&lt;/code>: Mirror URL for driver repositories.&lt;/li>
&lt;li>&lt;code>--browser-mirror-url&lt;/code>: Mirror URL for browser repositories.&lt;/li>
&lt;/ul>
&lt;p>As usual, these values can be configured using the config file or environment variable (e.g., &lt;code>SE_DRIVER_MIRROR_URL&lt;/code> or &lt;code>SE_BROWSER_MIRROR_URL&lt;/code>). Moreover, there are browser and driver-specific configuration keys, i.e. &lt;code>chrome-mirror-url&lt;/code>, &lt;code>firefox-mirror-url&lt;/code>, &lt;code>edge-mirror-url&lt;/code>, etc. (in the configuration file), and &lt;code>SE_CHROME_MIRROR_URL&lt;/code>, &lt;code>SE_FIREFOX_MIRROR_URL&lt;/code>, &lt;code>SE_EDGE_MIRROR_URL&lt;/code>, etc. (as environment variables).&lt;/p>
&lt;p>Here is an example of this feature calling Selenium Manager from the shell:&lt;/p>
&lt;pre tabindex="0">&lt;code>./selenium-manager --debug --browser chrome --browser-version 100 --avoid-browser-download --driver-mirror-url=https://registry.npmmirror.com/-/binary/chromedriver/
DEBUG chromedriver not found in PATH
DEBUG chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
DEBUG Running command: wmic datafile where name=&amp;#39;C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe&amp;#39; get Version /value
DEBUG Output: &amp;#34;\r\r\n\r\r\nVersion=117.0.5938.150\r\r\n\r\r\n\r\r\n\r&amp;#34;
DEBUG Detected browser: chrome 117.0.5938.150
DEBUG Discovered chrome version (117) different to specified browser version (100)
DEBUG Required driver: chromedriver 100.0.4896.60
DEBUG Downloading chromedriver 100.0.4896.60 from https://registry.npmmirror.com/-/binary/chromedriver/100.0.4896.60/chromedriver_win32.zip
INFO Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\100.0.4896.60\chromedriver.exe
INFO Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe
&lt;/code>&lt;/pre>&lt;h3 id="debug-release">Debug release&lt;/h3>
&lt;p>To troubleshoot Selenium Manager in complex error cases, it is interesting to capture the backtrace. But to do that, the Selenium Manager binaries must be created with the debug symbols. Since the resulting binaries with debug symbols are much larger than the default release artifacts, we generate them on demand using a custom &lt;a href="https://github.com/SeleniumHQ/selenium/actions/workflows/build-selenium-manager.yml">workflow in GitHub Actions&lt;/a>. This way, we have included a checkbox in the workflow for triggering the Selenium Manager build. When this checkbox is enabled when building Selenium Manager, the debug symbols will be added to the resulting binaries (for Windows, Linux, and macOS). All in all, these binaries will be used on demand to troubleshoot complicated problems.&lt;/p>
&lt;p>&lt;img src="selenium-manager-workflow-debug.png" alt="Selenium Manager workflow screenshot">&lt;/p>
&lt;h3 id="selenium-manager-in-cache-only-for-java-bindings">Selenium Manager in cache (only for Java bindings)&lt;/h3>
&lt;p>As of version 4.15.0 of the Selenium Java bindings, the Selenium Manager binary is extracted and copied to the cache folder. For instance, the Selenium Manager binary shipped with Selenium 4.15.0 is stored in the folder &lt;code>~/.cache/selenium/manager/0.4.15&lt;/code>). This feature will allow direct manipulation of Selenium Manager as a CLI tool, for instance, for troubleshooting. This feature is only available for Java bindings since Java is the only language that does not have direct access to the Selenium Manager binaries (since they are released compressed into the JAR files of the &lt;code>selenium-java&lt;/code> artifacts).&lt;/p>
&lt;h3 id="next-steps">Next steps&lt;/h3>
&lt;p>Look at &lt;a href="https://www.selenium.dev/documentation/selenium_manager/">Selenium Manager documentation&lt;/a> for a detailed description of its features. Also, you can trace the status of the development activities in the &lt;a href="https://github.com/orgs/SeleniumHQ/projects/5">Selenium Manager project dashboard&lt;/a>.&lt;/p></description></item><item><title>Blog: Status of Selenium Manager in October 2023</title><link>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/status_of_selenium_manager_in_october_2023/</link><pubDate>Tue, 17 Oct 2023 00:00:00 +0000</pubDate><guid>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/status_of_selenium_manager_in_october_2023/</guid><description>
&lt;p>Selenium Manager continues its development plan. As usual, in the latest releases, i.e., 0.4.13 and 0.4.14 (shipped with Selenium 4.13 and 4.14, respectively), we have fixed the problems reported so far. In these releases, the issues were related to the extraction of the Firefox binary from the self-extracting archive (SFX) in Windows and the advanced configuration through the configuration file (&lt;code>se-config.toml&lt;/code>) and environment variables (e.g., &lt;code>SE_BROWSER&lt;/code>). Moreover, these recent releases include new features, as explained below.&lt;/p>
&lt;h3 id="search-for-the-best-driver-possible-in-the-cache">Search for the best driver possible in the cache&lt;/h3>
&lt;p>By default, Selenium Manager needs to request online endpoints (such as &lt;a href="https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints">Chrome for Testing JSON API&lt;/a> or &lt;a href="https://wiki.mozilla.org/Release_Management/Product_details">Firefox product-details JSON API&lt;/a>
to discover, download, and maintain the proper drivers and browsers that Selenium requires. The downloaded artifacts are stored in the cache (by default, &lt;code>~/.cache/selenium&lt;/code>) and reused from there.&lt;/p>
&lt;p>To make the driver resolution procedure more robust, as of version 0.4.13, Selenium Manager includes a new feature for locating the drivers in the cache when some error happens. This way, when a network request (or other function) fails in Selenium Manager, it tries to locate the driver in the cache. This characteristic aims to provide a best-effort solution for creating a Selenium session properly, which is the final objective of Selenium Manager. Also, this feature will help to provide a better experience for locating drivers for Selenium Grid.&lt;/p>
&lt;h3 id="locating-selenium-manager-binary-with-an-environment-variable">Locating Selenium Manager binary with an environment variable&lt;/h3>
&lt;p>The next feature related to Selenium Manager 0.4.13 has been implemented in the Selenium bindings (i.e., Java, JavaScript, Python, .Net, and Ruby). As of Selenium 4.13.0, the Selenium bindings allow locating the Selenium Manager binary using an environment variable called &lt;code>SE_MANAGER_PATH&lt;/code>. This way, if this variable is set, the bindings will use its value as the Selenium Manager path in the local filesystem. This feature will allow users to provide a custom compilation of Selenium Manager, for instance, if the default binaries (compiled for Windows, Linux, and macOS) are incompatible with a given system (e.g., ARM64 in Linux).&lt;/p>
&lt;h3 id="automated-edge-management">Automated Edge management&lt;/h3>
&lt;p>Selenium Manager 0.4.14 includes automated Edge management. This browser is the last we have in mind for this feature, after Chrome and Firefox.&lt;/p>
&lt;p>This feature has been implemented in the same way that Chrome and Firefox for macOS and Linux. In other words, Selenium Manager allows to automatically manage (i.e., discover, downloads, and cache) the latest Edge versions (i.e., stable, beta, dev, canary) and old versions (e.g., 115, 116, etc.). The downloaded binaries, as usual, are stored in the Selenium cache. The following output commands showcase this feature in macOS (first snipped) and Linux (second snippet):&lt;/p>
&lt;pre tabindex="0">&lt;code>./selenium-manager --browser edge --debug --force-browser-download
DEBUG msedgedriver not found in PATH
DEBUG Checking edge releases on https://edgeupdates.microsoft.com/api/products
DEBUG Required browser: edge 117.0.2045.40
DEBUG Downloading edge 117.0.2045.40 from https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/6e65d9ef-0bb9-4636-8d9e-2b1b9d16149d/MicrosoftEdge-117.0.2045.40.pkg
DEBUG edge 117.0.2045.40 has been downloaded at /Users/boni/.cache/selenium/edge/mac64/117.0.2045.40/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
DEBUG Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_117_MACOS
DEBUG Required driver: msedgedriver 117.0.2045.40
DEBUG Downloading msedgedriver 117.0.2045.40 from https://msedgedriver.azureedge.net/117.0.2045.40/edgedriver_mac64.zip
INFO Driver path: /Users/boni/.cache/selenium/msedgedriver/mac64/117.0.2045.40/msedgedriver
INFO Browser path: /Users/boni/.cache/selenium/edge/mac64/117.0.2045.40/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
&lt;/code>&lt;/pre>&lt;pre tabindex="0">&lt;code>./selenium-manager --browser edge --debug --browser-version beta
DEBUG msedgedriver not found in PATH
DEBUG edge not found in PATH
DEBUG edge beta not found in the system
DEBUG Checking edge releases on https://edgeupdates.microsoft.com/api/products
DEBUG Required browser: edge 118.0.2088.11
DEBUG Downloading edge 118.0.2088.11 from https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-beta/microsoft-edge-beta_118.0.2088.11-1_amd64.deb
DEBUG edge 118.0.2088.11 has been downloaded at /home/user/.cache/selenium/edge/linux64/118.0.2088.11/msedge
DEBUG Reading msedgedriver version from https://msedgedriver.azureedge.net/LATEST_RELEASE_118_LINUX
DEBUG Required driver: msedgedriver 118.0.2088.11
DEBUG Downloading msedgedriver 118.0.2088.11 from https://msedgedriver.azureedge.net/118.0.2088.11/edgedriver_linux64.zip
INFO Driver path: /home/user/.cache/selenium/msedgedriver/linux64/118.0.2088.11/msedgedriver
INFO Browser path: /home/user/.cache/selenium/edge/linux64/118.0.2088.11/msedge
&lt;/code>&lt;/pre>&lt;p>Nevertheless, this feature cannot be implemented similarly for Windows. The reason is that the Edge installer for Windows is distributed as a Microsoft Installer (MSI) file, designed to be executed with administrator rights. We tried to extract the Edge binaries from that MSI file. Still, it seems not possible (see &lt;a href="https://stackoverflow.com/questions/77132922/extract-parse-resources-from-portable-executable-pe-file">Stack Overflow post that summarized the problem&lt;/a>). All in all, the only solution we found is to install Edge in Windows using the MSI installer, and so, administrator grants are required.&lt;/p>
&lt;p>This way, when Edge is attempted to be installed with Selenium Manager in Windows with a non-administrator session, a warning message will be displayed as follows:&lt;/p>
&lt;pre tabindex="0">&lt;code>./selenium-manager --debug --browser edge --browser-version beta
DEBUG msedgedriver not found in PATH
DEBUG edge not found in PATH
DEBUG edge beta not found in the system
WARN There was an error managing edge (edge can only be installed in Windows with administrator permissions); using driver found in the cache
INFO Driver path: C:\Users\boni\.cache\selenium\msedgedriver\win64\118.0.2088.17\msedgedriver.exe
&lt;/code>&lt;/pre>&lt;p>But when Selenium Manager is executed with administrator grants in Windows, it will be able to automatically discover, download, and install Edge (stable, beta, dev, canary, and older versions):&lt;/p>
&lt;pre tabindex="0">&lt;code>./selenium-manager --debug --browser edge --browser-version beta
DEBUG msedgedriver not found in PATH
DEBUG edge not found in PATH
DEBUG edge beta not found in the system
DEBUG Checking edge releases on https://edgeupdates.microsoft.com/api/products
DEBUG Required browser: edge 118.0.2088.17
DEBUG Downloading edge 118.0.2088.17 from https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/7adec542-f34c-4dea-8e2a-f8c6fab4d2f3/MicrosoftEdgeBetaEnterpriseX64.msi
DEBUG Installing MicrosoftEdgeBetaEnterpriseX64.msi
DEBUG edge 118.0.2088.17 is available at C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe
DEBUG Required driver: msedgedriver 118.0.2088.17
DEBUG msedgedriver 118.0.2088.17 already in the cache
INFO Driver path: C:\Users\boni\.cache\selenium\msedgedriver\win64\118.0.2088.17\msedgedriver.exe
INFO Browser path: C:\Program Files (x86)\Microsoft\Edge Beta\Application\msedge.exe
&lt;/code>&lt;/pre>&lt;h3 id="chromium-support">Chromium support&lt;/h3>
&lt;p>Chromium is released as portable binaries, distributed as zip files for Windows, Linux, and macOS (see &lt;a href="https://www.chromium.org/getting-involved/download-chromium/">Chromium download page&lt;/a>). Nevertheless, there is a case in which Chromium is actually installed in the system. This happens in Linux systems when installing Chromium through package managers like &lt;code>atp&lt;/code> or &lt;code>snap&lt;/code>, for instance, as follows:&lt;/p>
&lt;pre tabindex="0">&lt;code>sudo snap install chromium
&lt;/code>&lt;/pre>&lt;p>Therefore, as of 0.4.14, Selenium Manager looks for the Chromium binaries in the PATH when Chrome is not discovered. The following snippet showcases how this feature works in a Linux machine in which Chrome is not available, but Chromium has been installed through &lt;code>snap&lt;/code>:&lt;/p>
&lt;pre tabindex="0">&lt;code>./selenium-manager --browser chrome --debug
DEBUG chromedriver not found in PATH
DEBUG Found chromium in PATH: /snap/bin/chromium
DEBUG Running command: /snap/bin/chromium --version
DEBUG Output: &amp;#34;Chromium 117.0.5938.149 snap&amp;#34;
DEBUG Detected browser: chrome 117.0.5938.149
DEBUG Required driver: chromedriver 117.0.5938.149
DEBUG chromedriver 117.0.5938.149 already in the cache
INFO Driver path: /home/user/.cache/selenium/chromedriver/linux64/117.0.5938.149/chromedriver
INFO Browser path: /snap/bin/chromium
&lt;/code>&lt;/pre>&lt;h3 id="next-steps">Next steps&lt;/h3>
&lt;p>We are close to implementing all the features initially planned for Selenium Manager. You can trace the status of the development activities in the &lt;a href="https://github.com/orgs/SeleniumHQ/projects/5">Selenium Manager project dashboard&lt;/a>.&lt;/p></description></item><item><title>Blog: What's new in Selenium Manager 0.4.12, shipped with Selenium 4.12.0</title><link>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/whats_new_in_selenium_manager_0.4.12_shipped_with_selenium_4.12.0/</link><pubDate>Mon, 28 Aug 2023 00:00:00 +0000</pubDate><guid>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/whats_new_in_selenium_manager_0.4.12_shipped_with_selenium_4.12.0/</guid><description>
&lt;p>A new release of Selenium Manager is out. For this release, we made a relevant decision concerning the Selenium Manager versioning format. From now on, Selenium Manager will follow the same version as Selenium. Nevertheless, since Selenium Manager is still in beta, its major version is &lt;em>0&lt;/em>. Thus, Selenium &lt;strong>4.12.0&lt;/strong> is shipped with Selenium Manager &lt;strong>0.4.12&lt;/strong>.&lt;/p>
&lt;p>First, we made a substantial effort to stabilize the already available features on Selenium Manager. This way, the version includes several bug-fixing related to automated driver management or caching. You can find the details of the changes implemented in Selenium Manager 0.4.12 in the (newly created) &lt;a href="https://github.com/SeleniumHQ/selenium/blob/trunk/rust/CHANGELOG.md">changelog file&lt;/a>.&lt;/p>
&lt;p>Besides, for this release, we made a significant update to the &lt;a href="https://www.selenium.dev/documentation/selenium_manager/">documentation page of Selenium Manager&lt;/a>. This page contains all the fine-grained information related to automated driver and browser management, configuration, etc. Also, it has several &lt;strong>TL;DR&lt;/strong> summarizing the main ideas for the eager reader.&lt;/p>
&lt;h3 id="automated-firefox-management">Automated Firefox management&lt;/h3>
&lt;p>After shipping automated browser management based on &lt;a href="https://googlechromelabs.github.io/chrome-for-testing/">Chrome for Testing&lt;/a> on the previous release, Selenium Manager 0.4.12 continues the job by providing automated &lt;strong>Firefox&lt;/strong> management. This way, Selenium Manager 0.4.12 allows us to manage the different Firefox releases (for Windows, Linux, and macOS), making them seamlessly available for Selenium.&lt;/p>
&lt;p>The procedure is the same as with Chrome. When Firefox is unavailable in the machine running Selenium, it is automatically discovered, downloaded, and cached by Selenium. If no version is specified, the latest stable Firefox release is managed by Selenium Manager. Besides, the bindings can use a browser option called &lt;a href="https://www.selenium.dev/documentation/webdriver/drivers/options/#browserversion">browserVersion&lt;/a> to specify a particular Firefox release (e.g., 114, 115, etc.). Finally, the label &lt;code>stable&lt;/code> allows us to manage the current stable Firefox release explicitly, and the labels &lt;code>beta&lt;/code>, &lt;code>dev&lt;/code>, and &lt;code>nightly&lt;/code> as used for unstable Firefox releases.&lt;/p>
&lt;p>This feature is possible thanks to the remarkable work of the Firefox team by maintaining current and old releases in their &lt;a href="https://ftp.mozilla.org/pub/firefox/releases/">public repository&lt;/a>. Moreover, the Firefox version discovery in Selenium Manager is made thanks to the availability of the &lt;a href="https://wiki.mozilla.org/Release_Management/Product_details">product-details JSON API&lt;/a>, also maintained by the Firefox team.&lt;/p>
&lt;h3 id="improved-configuration">Improved configuration&lt;/h3>
&lt;p>Custom setup is sometimes necessary for browser automation. For that reason, Selenium Manager already provides different features for &lt;a href="https://www.selenium.dev/documentation/selenium_manager/#configuration">rich configuration&lt;/a>. Selenium Manager 0.4.12 extends this feature by delivering a new configuration argument called &lt;code>--cache-path&lt;/code>. This argument allows changing the path of the local folder used to store downloaded assets (drivers and browsers) by Selenium Manager (by default, &lt;code>~/.cache/selenium&lt;/code>). As usual, this argument can also be changed by including an entry in the configuration file or using an environment variable (&lt;code>SE_CACHE_PATH&lt;/code>). Regarding the former, the name of the configuration file has been renamed to &lt;code>se-config.toml&lt;/code> in Selenium Manager 0.4.12. As usual, if you use this configuration file, it must be placed in the root of the cache folder.&lt;/p>
&lt;h3 id="other-changes">Other changes&lt;/h3>
&lt;p>A minor change in Selenium Manager 0.4.12 is related to the metadata file, now called &lt;code>se-metadata.json&lt;/code>. As usual, this file is stored in the root of the cache folder. This file contains versions discovered by Selenium Manager making network requests and the &lt;em>time-to-live&lt;/em> (TTL) in which they are valid. Since the TTL for browsers and drivers is now the same concept, Selenium Manager unifies these two configuration elements (previously, &lt;code>browser_ttl&lt;/code> and &lt;code>driver_ttl&lt;/code>) in a single one called &lt;code>ttl&lt;/code> (with a default value of 3600 seconds, i.e., 1 hour). For further details, visit the Selenium Manager page about &lt;a href="https://www.selenium.dev/documentation/selenium_manager/#caching">caching&lt;/a>.&lt;/p>
&lt;p>Last but not least, the Selenium Manager binary compiled for macOS is &lt;em>universal&lt;/em>, in the sense that it can be executed both in &lt;em>x64&lt;/em> and &lt;em>arm64&lt;/em> architectures out of the box. Previously, the binary was compiled for &lt;em>x64&lt;/em>, and so, &lt;a href="https://support.apple.com/en-us/HT211861">Rosetta&lt;/a> should be available in &lt;em>arm64&lt;/em> macOS machines (i.e., M1 or M2). With the new Selenium Manager macOS binary, Rosetta is no longer mandatory.&lt;/p>
&lt;h3 id="next-steps">Next steps&lt;/h3>
&lt;p>The next release of Selenium Manager will continue delivering automated browser management, this time for &lt;strong>Edge&lt;/strong>, and other features. As usual, you can trace the work in progress in the &lt;a href="https://github.com/orgs/SeleniumHQ/projects/5">Selenium Manager project dashboard&lt;/a>.&lt;/p></description></item><item><title>Blog: What's new in Selenium Manager with Selenium 4.11.0</title><link>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/whats-new-in-selenium-manager-with-selenium-4.11.0/</link><pubDate>Mon, 31 Jul 2023 00:00:00 +0000</pubDate><guid>https://trunk--polite-jelly-cc0866.netlify.app/blog/2023/whats-new-in-selenium-manager-with-selenium-4.11.0/</guid><description>
&lt;p>As of version &lt;a href="https://www.selenium.dev/blog/2022/introducing-selenium-manager/">4.6.0&lt;/a>, all releases of Selenium (Java, JavaScript, Python, Ruby, and .Net) are shipped with &lt;strong>Selenium Manager&lt;/strong>. &lt;a href="https://www.selenium.dev/documentation/selenium_manager/">Selenium Manager&lt;/a> is a binary tool (implemented in Rust) that provides automated driver management for Selenium. &lt;a href="https://www.selenium.dev/documentation/selenium_manager/">Selenium Manager&lt;/a> is still in beta, although it is becoming a relevant component of Selenium.&lt;/p>
&lt;p>So far, the main feature of Selenium Manager is called &lt;em>automated driver management&lt;/em>. I use the term &lt;em>management&lt;/em> for this feature (and not just &lt;em>download&lt;/em>) since this process is broader and implies different steps:&lt;/p>
&lt;ol>
&lt;li>Browser version discovery. Selenium Manager discovers the browser version (e.g., Chrome, Firefox, Edge) installed in the machine that executes Selenium. For this step, shell commands are used (e.g., &lt;code>google-chrome --version&lt;/code>).&lt;/li>
&lt;li>Driver version discovery. With the discovered browser version, the proper driver version is resolved. For this step, the online metadata maintained by the browser vendors (e.g., &lt;a href="https://chromedriver.chromium.org/downloads">chromedriver&lt;/a>, &lt;a href="https://github.com/mozilla/geckodriver/releases">geckodriver&lt;/a>, or &lt;a href="https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/">msedgedriver&lt;/a>) are used.&lt;/li>
&lt;li>Driver download. With the resolved driver version, the driver URL is obtained; with that URL, the driver artifact is downloaded, uncompressed, and stored locally.&lt;/li>
&lt;li>Driver cache. Uncompressed driver binaries are stored in a local cache folder (&lt;code>~/.cache/selenium&lt;/code>). The next time the same driver is required, if the driver is already in the cache, it will be used from there.&lt;/li>
&lt;/ol>
&lt;h3 id="drivers-on-the-path">Drivers on the PATH&lt;/h3>
&lt;p>Driver management through Selenium Manager is &lt;em>opt-in&lt;/em> for the Selenium bindings. Thus, users can continue managing their drivers manually (putting the driver in the &lt;code>PATH&lt;/code> or using system properties) or rely on a third-party &lt;em>manager&lt;/em> to do it automatically. Selenium Manager only operates as a fallback: if no driver is provided, Selenium Manager will come to the rescue. Nevertheless, Selenium Manager also helps users to identify potential problems with the drivers on the &lt;code>PATH&lt;/code>.&lt;/p>
&lt;p>Let&amp;rsquo;s consider an example. Imagine you manually manage your chromedriver for your Selenium tests. When you carry out this management, the stable version of Chrome is 113, so you download chromedriver 113 and put it in your &lt;code>PATH&lt;/code>. Your Selenium tests execute. Everything is fine. But the &lt;em>problem&lt;/em> here is that Chrome is &lt;em>evergreen&lt;/em>. This name refers to Chrome&amp;rsquo;s ability to upgrade automatically and silently to the next stable version when available. This feature is excellent for end-users but potentially dangerous for automated testing. Let&amp;rsquo;s go back to the example to discover it. Your local Chrome will eventually update to version 115. And that moment, your Selenium tests will be broken due to the incompatibility of the manually managed driver (113) and your Chrome (115). That day, your test dashboard will be red due to the following error message: &lt;em>&amp;ldquo;session not created: This version of ChromeDriver only supports Chrome version 113&amp;rdquo;&lt;/em>.&lt;/p>
&lt;p>This problem is the primary reason for the existence of the so-called &lt;em>driver managers&lt;/em>. And as of Selenium 4.11, Selenium Manager helps to understand potential issues related to the drivers in the &lt;code>PATH&lt;/code>. When an incompatible driver release is found in the &lt;code>PATH&lt;/code>, a warning message like the following is displayed to the user:&lt;/p>
&lt;pre tabindex="0">&lt;code>WARN The chromedriver version (113.0.5672.63) detected in PATH at C:\my-drivers\chromedriver.exe might not be compatible with the detected chrome version (115.0.5790.110); currently, chromedriver 115.0.5790.102 is recommended for chrome 115.*, so it is advised to delete the driver in PATH and retry
&lt;/code>&lt;/pre>&lt;h3 id="entering-chrome-for-testing-cft">Entering Chrome for Testing (CfT)&lt;/h3>
&lt;p>The Chrome team started a very relevant initiative for the testing community in 2023: &lt;a href="https://googlechromelabs.github.io/chrome-for-testing/">Chrome for Testing (CfT)&lt;/a>. CfT is a reduced release of Chrome primarily addressed to the testing use case.&lt;/p>
&lt;p>One of the key differences between a regular Chrome release and CfT is that Chrome is &lt;em>evergreen&lt;/em>, but CfT is not. This way, CfT allows pined browsers for testing. CfT releases are portable binaries (for Windows, Linux, and macOS) for different versions, including the stable, beta, dev, and canary channels. These releases can be programmatically discovered using the &lt;a href="https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints">CfT JSON endpoints&lt;/a>.&lt;/p>
&lt;p>As of version 114, the chromedriver team has stopped publishing the chromedriver releases and metadata using their traditional &lt;a href="https://chromedriver.chromium.org/downloads">chromedriver download repository&lt;/a>. This way, and as of version 115, chromedriver releases can only be discovered programmatically using the abovementioned &lt;a href="https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints">CfT JSON endpoints&lt;/a>.&lt;/p>
&lt;p>This change has been very relevant for the so-called driver managers. Luckily, Selenium already supports this new way of chromedriver discovery. The last version of Selenium Manager uses the CfT endpoints for chromedriver management. Therefore, if you are using Selenium Manager and Chrome, you must be updated to Selenium 4.11.0 to continue managing chromedriver automatically.&lt;/p>
&lt;h3 id="automated-browser-management">Automated browser management&lt;/h3>
&lt;p>Moreover, as of Selenium 4.11.0, Selenium Manager implements automated browser management based on CfT. In other words, Selenium Manager uses the CfT endpoints to discover, download, and cache the different CfT releases, making them seamlessly available for Selenium.&lt;/p>
&lt;p>Let&amp;rsquo;s suppose we want to driver Chrome with Selenium (see the doc about how to &lt;a href="https://www.selenium.dev/documentation/webdriver/getting_started/first_script/#1-start-the-session">start a session with Selenium&lt;/a>). Before the session begins, and when the driver is unavailable, Selenium Manager manages chromedriver for us. This way, all the complexity related to CfT endpoints, driver versions, etc., is transparent, and we can rely on Selenium Manager to discover, download, and cache the proper driver for us.&lt;/p>
&lt;p>In addition, and as a significant novelty starting on Selenium 4.11.0, if Chrome is not installed on the local machine when executing the previous line, the current stable CfT release is discovered, downloaded, and cached (in &lt;code>~/.cache/selenium/chrome&lt;/code>). But there is more. In addition to the stable CfT version, Selenium Manager also allows downloading of older versions of CfT (starting in version 113, which is the first version published as CfT).&lt;/p>
&lt;p>To set a browser version with Selenium, we use a browser option called &lt;a href="https://www.selenium.dev/documentation/webdriver/drivers/options/#browserversion">browserVersion&lt;/a>.
Until now, the value of this option had no effect when using the local browser since Selenium could not change what is installed in the system. But things are different with Selenium 4.11.0.&lt;/p>
&lt;p>Let&amp;rsquo;s consider a simple example. Suppose we set &lt;code>browserVersion&lt;/code> to &lt;code>114&lt;/code> using &lt;a href="https://www.selenium.dev/documentation/webdriver/browsers/chrome/">Chrome options&lt;/a>. In this case, Selenium Manager will check if Chrome 114 is already installed. If it is, it will be used. If not, Selenium Manager will manage (i.e., discover, download, and cache) CfT 114. And in either case, the chromedriver is also managed. Finally, Selenium will start Chrome to be driven programmatically, as usual.&lt;/p>
&lt;p>But there is even more. In addition to fixed browser versions (e.g., &lt;code>113&lt;/code>, &lt;code>114&lt;/code>, &lt;code>115&lt;/code>, etc.), we can use the following labels for &lt;code>browserVersion&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>&lt;code>stable&lt;/code>: Current CfT version.&lt;/li>
&lt;li>&lt;code>beta&lt;/code>: Next version to stable.&lt;/li>
&lt;li>&lt;code>dev&lt;/code>: Version in development at this moment.&lt;/li>
&lt;li>&lt;code>canary&lt;/code>: Nightly build for developers.&lt;/li>
&lt;/ul>
&lt;p>When these labels are specified, Selenium Manager first checks if a given Chrome is already installed (&lt;code>beta&lt;/code>, &lt;code>dev&lt;/code>, etc.), and when it is not detected, CfT is automatically managed.&lt;/p>
&lt;h3 id="under-the-hood">Under the hood&lt;/h3>
&lt;p>Selenium Manager is a CLI (command line interface) tool implemented in Rust and compiled for Windows, Linux, and macOS. The Selenium Manager binaries are shipped with each Selenium release. This way, each Selenium binding language invokes Selenium Manager to carry out the automated driver and browser management previously explained.&lt;/p>
&lt;p>For most users, Selenium Manager should work silently and transparently. But if you want to &lt;em>play&lt;/em> with Selenium Manager or use it for your own use case (e.g., to download drivers or CfT releases), you can get the Selenium Manager binaries from the &lt;a href="https://github.com/SeleniumHQ/selenium/tree/trunk/common/manager">Selenium main repository&lt;/a>.&lt;/p>
&lt;p>For instance, to manage Chrome/chromedriver, the Selenium Manager command we need to invoke from the shell is the following (notice that the flag &lt;code>--debug&lt;/code> is optional, but it helps us to understand what Selenium Manager is doing):&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;gt; selenium-manager --browser chrome --debug
DEBUG Checking chromedriver in PATH
DEBUG Running command: chromedriver --version
DEBUG Output: &amp;#34;&amp;#34;
DEBUG chromedriver not found in PATH
DEBUG chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
DEBUG Using shell command to find out chrome version
DEBUG Running command: wmic datafile where name=&amp;#39;C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe&amp;#39; get Version /value
DEBUG Output: &amp;#34;\r\r\n\r\r\nVersion=115.0.5790.110\r\r\n\r\r\n\r\r\n\r&amp;#34;
DEBUG Detected browser: chrome 115.0.5790.110
DEBUG Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
DEBUG Required driver: chromedriver 115.0.5790.102
DEBUG Driver URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/win64/chromedriver-win64.zip
INFO Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\115.0.5790.102\chromedriver.exe
INFO Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe
&lt;/code>&lt;/pre>&lt;p>In this case, the local Chrome (in Windows) is detected by Selenium Manager. Then, using its version and the CfT endpoints, the proper chromedriver version (115, in this example) is downloaded to the local cache. Finally, Selenium Manager provides two results: i) the driver path (downloaded) and ii) the browser path (local).&lt;/p>
&lt;p>Let&amp;rsquo;s consider another example. Now we want to use Chrome beta. Therefore, we invoke Selenium Manager specifying that version label as follows (notice that the CfT beta is discovered, downloaded, and stored in the local cache):&lt;/p>
&lt;pre tabindex="0">&lt;code>&amp;gt; selenium-manager --browser chrome --debug --browser-version beta
DEBUG Checking chromedriver in PATH
DEBUG Running command: chromedriver --version
DEBUG Output: &amp;#34;&amp;#34;
DEBUG chromedriver not found in PATH
DEBUG Checking chrome in PATH
DEBUG Running command: where chrome
DEBUG Output: &amp;#34;&amp;#34;
DEBUG chrome not found in PATH
DEBUG chrome has not been discovered in the system
DEBUG Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json
DEBUG Required browser: chrome 116.0.5845.49
DEBUG Downloading chrome 116.0.5845.49 from https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chrome-win64.zip
DEBUG chrome 116.0.5845.49 has been downloaded at C:\Users\boni\.cache\selenium\chrome\win64\116.0.5845.49\chrome.exe
DEBUG Reading metadata from https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json
DEBUG Required driver: chromedriver 116.0.5845.49
DEBUG Driver URL: https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.49/win64/chromedriver-win64.zip
INFO Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\116.0.5845.49\chromedriver.exe
INFO Browser path: C:\Users\boni\.cache\selenium\chrome\win64\116.0.5845.49\chrome.exe
&lt;/code>&lt;/pre>&lt;h3 id="troubleshooting-in-the-bindings">Troubleshooting in the bindings&lt;/h3>
&lt;p>If you want to get the Selenium Manager debugging information (as shown in the section before) when using the Selenium bindings languages, you can enable the logging capabilities of Selenium.
Please visit the &lt;a href="https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/">Selenium troubleshooting page&lt;/a> for details.&lt;/p>
&lt;h3 id="next-steps">Next steps&lt;/h3>
&lt;p>You can trace the work in progress in the &lt;a href="https://github.com/orgs/SeleniumHQ/projects/5">Selenium Manager project dashboard&lt;/a>. The following features to be implemented in Selenium Manager will continue the automated browser management mechanism, this time for &lt;strong>Firefox&lt;/strong> and &lt;strong>Edge&lt;/strong>. Stay tuned!&lt;/p></description></item><item><title>Blog: Introducing Selenium Manager</title><link>https://trunk--polite-jelly-cc0866.netlify.app/blog/2022/introducing-selenium-manager/</link><pubDate>Fri, 04 Nov 2022 00:00:00 +0000</pubDate><guid>https://trunk--polite-jelly-cc0866.netlify.app/blog/2022/introducing-selenium-manager/</guid><description>
&lt;p>Most people&amp;rsquo;s first experience with Selenium ends up with an error message like this one:&lt;/p>
&lt;pre tabindex="0">&lt;code>java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver
system property; for more information, see https://chromedriver.chromium.org/. The latest version can be
downloaded from https://chromedriver.chromium.org/downloads
&lt;/code>&lt;/pre>&lt;p>Then they have to search the web for instructions on what to do with the drivers they download.&lt;/p>
&lt;h3 id="selenium-now-with-batteries-included">Selenium: now with batteries included!&lt;/h3>
&lt;p>The Selenium project wants to improve the user experience, and one of the first steps is to help all users to
simplify how they set up their environment. Configuring browser drivers has been for many years a task which
users need to perform in order to have a working environment to run Selenium.&lt;/p>
&lt;p>Setting up a browser driver once is not that complicated, but as browser release cycles got shorter, and now
we have a new Chrome/Firefox/Edge version every 4-6 weeks, the task of keeping the browser driver in sync with
the browser version is not that easy anymore.&lt;/p>
&lt;p>Selenium Manager is a new tool that helps to get a working environment to run Selenium out of the box. Beta 1
of Selenium Manager will configure the browser drivers for Chrome, Firefox, and Edge if they are not present
on the &lt;code>PATH&lt;/code>.&lt;/p>
&lt;p>To run a Selenium test with Selenium 4.6, you only need to have Chrome, Firefox, or Edge installed. If you
already have browser drivers installed, this feature will be ignored. If you&amp;rsquo;d like to help us test it, though,
delete your drivers or remove your third party driver manager and things should still &amp;ldquo;just work.&amp;rdquo; If they don&amp;rsquo;t,
please file a &lt;a href="https://github.com/SeleniumHQ/selenium/issues">bug report&lt;/a>.&lt;/p>
&lt;p>Future releases of Selenium Manager will eventually even download browsers if necessary.&lt;/p>
&lt;h3 id="inspired-by-open-source-and-the-selenium-community">Inspired by Open Source and the Selenium Community&lt;/h3>
&lt;p>Selenium Manager is not a completely new solution. Over the years, several third-party projects in the Selenium
ecosystem emerged. Such as: &lt;a href="https://bonigarcia.dev/webdrivermanager/">WebDriverManager&lt;/a> for Java,
&lt;a href="https://pypi.org/project/webdriver-manager/">webdriver-manager&lt;/a> for Python,
&lt;a href="https://github.com/titusfortner/webdrivers">webdrivers&lt;/a> for Ruby, and
&lt;a href="https://github.com/rosolko/WebDriverManager.Net">WebDriverManager.Net&lt;/a> for C#.&lt;/p>
&lt;p>All these projects served as an
&lt;a href="https://trunk--polite-jelly-cc0866.netlify.app/documentation/webdriver/troubleshooting/errors/driver_location/#driver-management-libraries">inspiration&lt;/a>
and as a clear sign that the community needed this feature to be
built-in Selenium. In addition, a &lt;a href="https://www.selenium.dev/blog/2021/selenium-survey-results/">survey&lt;/a>
done on January 2021 showed that most Selenium users want to get rid of the driver management
problem. Plus, the fact that the
&lt;a href="https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location/">driver installation&lt;/a> page is
by far the most visited one in the Selenium documentation.&lt;/p>
&lt;h3 id="selenium-manager-in-detail">Selenium Manager in detail&lt;/h3>
&lt;p>Selenium Manager is a CLI (Command-Line Interface) tool developed in Rust to allow cross platform execution.
On its beta 1 version, Selenium Manager is invoked transparently by the Selenium bindings when no browser
driver is detected on the &lt;code>PATH&lt;/code> or no third party driver manager is being used.&lt;/p>
&lt;p>You can also use Selenium Manager without the Selenium bindings. While we plan to do formal releases in the
future, for now, the binaries can be found directly on the
&lt;a href="https://github.com/SeleniumHQ/selenium/tree/trunk/common/manager">Selenium repository&lt;/a>. Check the different
parameters and options by running the following command:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ ./selenium-manager --help
&lt;/code>&lt;/pre>&lt;p>A quick example showing how &lt;code>ChromeDriver&lt;/code> gets configured can be seen below:&lt;/p>
&lt;pre tabindex="0">&lt;code>$ ./selenium-manager --browser chrome
INFO /home/boni/.cache/selenium/chromedriver/linux64/106.0.5249.61/chromedriver
&lt;/code>&lt;/pre>&lt;p>If you maintain a WebDriver based project and would like to use Selenium Manager as well,
join us in our &lt;a href="https://trunk--polite-jelly-cc0866.netlify.app/support/#ChatRoom">community channels&lt;/a> and we would be happy to help.
Also, if you are interested in contributing, for detailed instructions and information
check the project&amp;rsquo;s &lt;a href="https://github.com/SeleniumHQ/selenium/tree/trunk/rust">README&lt;/a>.&lt;/p>
&lt;h3 id="next-steps">Next steps&lt;/h3>
&lt;p>Selenium Manager is still under development, features will be added and bugs fixed along with each release.
However, you as a member of the Selenium community are key part on the future success of this new tool. Please
report ideas or bugs through our &lt;a href="https://github.com/SeleniumHQ/selenium/issues">issue tracker&lt;/a> and join
the conversation through our &lt;a href="https://trunk--polite-jelly-cc0866.netlify.app/support/#ChatRoom">community channels&lt;/a>. Looking forward to your feedback!&lt;/p>
&lt;p>Happy testing!&lt;/p></description></item></channel></rss>