Selenium 4.11 officially released--no need to manually update chrome driver anymore

Selenium 4.11.0 has been officially released. Let’s take a look at the main features first.

Versions supported by Chrome DevTools are now: v113, v114 and v115 (Firefox still uses v85 for all versions)
Chrome For Testing (CfT) is supported through Selenium Manager
Selenium Manager can now locate the driver's binaries on the PATH or configured path, check potential incompatibilities and provide better warning and error messages.
Builds for Ruby and Java are pushed nightly. Support for other languages ​​is coming soon.
Ignore process ID matching when looking up window handle - IE mode on Edge.
The most important update here is support for Chrome For Testing.

Chrome For Testing

This is a browser launched by Chrome specifically for testing scenarios , in order to solve some of the following pain points:

Automatic updates for chrome. Automatic updates: Convenient for users, painful for developers, especially testers, because we want (a) consistent and repeatable results on repeated test runs, but if the browser can execute A file or binary decides to update itself between runs, which ruins everything. (b) We want to pin a specific browser version and add that version number to your source code repository so you can checkout old commits and branches and rerun tests to use that point in time Browser binaries for testing. For the above two reasons, automatic updates make people want to get rid of them quickly.

A specific version of the chrome browser cannot be downloaded. In addition to automatic updates, you may also find it difficult to find specific versions of Chrome binaries. Google intentionally does not provide Chrome downloads with version numbers because users should not care about version numbers and they should update to the latest version as soon as possible. This is great for users, but a pain for developers who need to reproduce bug reports in older versions of Chrome. A more specific example of this problem is when you want to use ChromeDriver for browser automation. Not only do you need to download the Chrome binary somehow, but you also need a corresponding version of the ChromeDriver binary to ensure the two binaries are compatible.

In this context, chrome for testing came into being. The official statement is

To address these issues, Chrome for Testing is a dedicated version of Chrome that is optimized for test cases, does not automatically update, is integrated with the Chrome release process, and is available with every Chrome release. This version of the binary is as close to regular Chrome as possible without negatively impacting test cases.

To create Chrome for testing, we have made modifications to the Chromium and Chrome codebases and set up the infrastructure to build and upload these binaries to a publicly available bucket, in sync with Chrome's release process, covering all Channels (stable, beta, development and grayscale).

The specific installation method is through npm

# Download the latest available Chrome for Testing binary corresponding to the Stable channel.
npx @puppeteer/browsers install chrome@stable

# Download a specific Chrome for Testing version.
npx @puppeteer/browsers install [email protected]

# Download the latest available ChromeDriver version corresponding to the Canary channel.
npx @puppeteer/browsers install chromedriver@canary

# Download a specific ChromeDriver version.
npx @puppeteer/browsers install [email protected]

In selenium 4.11, we can install chrome for testing directly through Selenium Manager. The specific method is https://www.selenium.dev/blog/2023/whats-new-in-selenium-manager-with-selenium -4.11.0/ is introduced in this article.

To sum up in one sentence: No need to manually update chrome driver anymore! !

Other details

Java

Make user defined SlotMatcher used everywhere in Grid code (#12240)
Add support for FedCM commands (#12096)
JavaScript

BiDi Add Network module events (#12197)

NET

Implementation of event wrapped shadow root element (#12073)
Allow setting a different pointer, keyboard, or wheel on input device (#11513)
Add move to location method to Actions (#11509)
Add support for Safari Technology Preview (#12342)
Fix error when we send non-base64 data for fetch command (#12431)
Fix continueResponse method in CDP (#12445)

Python

removed redundant attributes capabilities and set_capability in wpewebkit/options.py (#12169)
improve driver logging, implement log_output() for flexibility and consistency of driver logging (#12103)
let users pass service args to IE driver (#12272)
Expose WPEWebKitService and WebKitGTKService in the public API
Remove deprecated ActionChains.scroll(…)
Add creation flag for windows in selenium_manager (#12435)

Ruby

Made network interception threads fail silently (#12226)
Remove deprecated code (#12417)

Finally, I would like to thank everyone who reads my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, if you can use it, you can take it directly:

Insert image description here

This information should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can also help you!   

おすすめ

転載: blog.csdn.net/2301_78843735/article/details/133134696