CẬP NHẬT NHỮNG THAY ĐỔI TRONG PHIÊN BẢN SELENIUM 4

Anh Tester chia sẻ đến bạn các thông tin thay đổi cập nhật mới nhất trong phiên bản Selenium 4 với các lần released chính thức.

Tất cả các ngôn ngữ lập trình: https://github.com/SeleniumHQ/selenium/releases

Dưới đây là những cập nhật trong ngôn ngữ lập trình Java:

v4.15.0

======

* Fixed the characteristics of the collector
* Marked Client Config version field as final. (#12941)
* Removed use of guava from browser packages
* Removed use of guava from devtools (#12943)
* Do not set browser binary if it is an empty string (#12738)
* Allow setting proxy for all http client instances (#12940)
* Ensure request can be modified while intercepting (#12930)
* Add BiDi browsing contexts events related to navigation and user prompt
* Update Actions.java as removed modifier keys (#12903)
* Removed the unused netty domain socket client and dependencies
* Removed the guava reference from os, manager, bidi package
* Removed the unused sockets test base
* Removed most usages of guava from the support package
* Copy SM binary to cache folder and use it from there (#11359) (#12539)
* Prevent browser to be created and unused in case a short session-request-timeout is set (#12848)
* Add BiDi request data types from Network module
* Remove the http2-settings header in the reverse proxy
* Add BiDi network response data type, network initiator type
* Add value key to delete downloadFile response per w3c convention (#13025)
* Add BiDi BeforeRequestSent type
* Add BiDi mechanism to listen to network event - beforeRequestSent
* Fix bug in downloading files by ensuring browser vendor options in capabilities (#13024)
* Add BiDi network module events - onResponseStarted and onResponseCompleted
* Fixed processing continuation frames #12962
* Remove CDP version dependencies in the server (#12502)
* Add placeholder for BiDi script module commands and events
* Add BiDi script types, remote reference types, and local value types for script module
* Change local value method name for BiDi serialization
* Fixed the invalid session id response #12655
* Add BiDi channel value type, remote value type and evaluate result types
* Add BiDi call script command, evaluate function command, disown command, get realms command
* Open the selenium-manager to the selenium-json package for the Java Module System
* Add message to exception error for downloads error
* Add BiDi command to add and remove preload script
* Add CDP v119 and remove v116
* Implement file downloads (#12979)

 

v4.14.1

======
* Add print, activate and set viewport commands to Browsing Context
* Remove deprecated lift packages (#12917)
* Add validation for browsing context id (#12920)
* Fix default values for print options page size
* Use the java process builder to run external processes (#12898)
* Allow a custom timeout when shutting down a process
* Replacing Guava implementations with native Java implementations
* Allow setting version in Http Client Config (#12919)


v4.14.0

======
* Supported CDP versions: 85, 116, 117, 118
* Replace the EventAttribute(Value) with an AttributeMap (#12684)
* Add browsing context's capture box and element screenshot commands
* Enable handle user prompt tests for Firefox
* Delete SM binary only when SE_MANAGER_PATH is not set (#12840)
* Shutdown executors created for a single tasks
* Ensure closed socket connection does not prevent freeing up resources
* Remove the unused htmlunit-driver from the unit tests (#12849)
* Ensure proper error message gets logged (#12853)
* Allow setting SSL context in client config for HttpClient (#12874)
* Improve warning when CDP version not found (#12880)
* Ensure retry mechanism does not swallow an exception (#12838)
* Require Java 11 and move jdk-http-client into default package (#12843)
* Reduce log noise at FINE level (#12866)
* Refactor frame method to use isEmpty for list check and String check. (#12894)
* Use new 'getArray' method to extract driver configurations (#12716)

v4.13.0

======
* Supported CDP versions: 85, 115, 116, 117
* Deprecate setScriptTimeout(), use scriptTimeout()
* Remove deprecated method move on Point class
* Remove deprecated method GeckoDriverService usingFirefoxBinary, use setBinary
* Remove deprecated method GeckoDriverService createDefaultService with capabilities
* Remove deprecated onConsoleLog in BiDi LogInspector
* Fix NewSession Runner (#12700)
* Add 'getArray' method for array values (#12703)
* Ensure HttpClients not closed while waiting for responses
* Fix bug for overwriting driver log output stream passed in by user
* Update pinned browser versions
* Improve stability with final variables (#12733)
* Fix bug for Appium subclass that sets neither log file nor output (#12696)
* Remove deprecated headless methods from Options classes
* Remove deprecated driver service constructors and methods
* Remove deprecated log_file methods
* Allow users to set Selenium Manager path by environment variable (#12752)

 

Selenium for .NET (4.12.3) and Java (4.12.1) has just been released with bug fixes and improvements.

v4.12.1

======
* Supported CDP versions: 85, 114, 115, 116
* Safari driver service system properties should be public
* [grid] Removing browserVersion before sending payload to driver
* Selenium Manager don't log file paths by default (#12673)
* Parse log output to support streams and file location in system properties (#12674)
* Fixing default service for drivers #12682

v4.12.0

======
* Supported CDP versions: 85, 114, 115, 116
* Update Selenium Manager to use io for executing command line
* Improve logic for deleting Selenium Manager binary on exit
* Remove deprecated BROWSER_LOGFILE
* Ensure grid maps exceptions to the correct error
* Allow deleting remote downloaded files from grid (#12501)
* Deprecate the Remote Response status field
* Remove deprecated UNEXPECTED_ALERT_BEHAVIOR capability in IE Options
* Deprecate disableNativeEvents method in IE Options
* Remove deprecated createPointerDown and createPointerUp methods
* use devtools script pinning mechanism by default (#11622)
* ensure all headers are removed or replaced
* Remove deprecated /file JWP endpoint (#12354)
* Increase maximum depth of generated JSON (see #12581)
* Do not register multiple listeners
* Improve synchronization for network event listeners
* Fix bug for null hashCode in element subclasses (#12442)
* Fix potential deadlock in processing events (#12576)
* Fix proxy breaking in RemoteWebDriver (#12607)
* Grid detects Safari and Safari Technology Preview only on macOS
* Grid avoids using Selenium Manager offline mode when it is enabled in arguments
* Batch copy input to multiple streams
* Remove browserVersion from options in Selenium Manager (#12639)

Highlights

  • Chrome DevTools support is now: v114, v115, and v116 (Firefox still uses v85 for all versions)
  • Quite a few fixes for Selenium Manager, and now with Firefox browser management! Read about all the new Selenium Manager features
  • .NET only explicitly targets netstandard2.0
  • Python no longer supports Python 3.7
  • Ruby no longer supports :capabilities arguments for local drivers (must use :options now)


Những cải tiến có liên quan cho mỗi ngôn ngữ

  • Java
    • Several improvements in working with Selenium Manager
    • Allow deleting remote downloaded files from grid (#12501)
    • Removed deprecated UNEXPECTED_ALERT_BEHAVIORBROWSER_LOGFILEcreatePointerDowncreatePointerUp and JWP /file endpoint
    • Deprecated disableNativeEvents and Remote Response status field
    • See all changes
  • Ruby
    • Fix bug preventing good error messages in Selenium Manager when stdout empty
    • Fix bug with Firefox not loading net/http library by default (#12506)
    • See all changes

 

v4.11.0

======
* Supported CDP versions: 85, 113, 114, 115
* Add Missing W3C Exceptions (#12175)
* Increased the max depth of new session payload (#12205)
* Create less HttpClient instances while creating a CDP connection (#12216)
* Raise a ConnectionFailedException when openSocket failed (#12215)
* Ack the log file argument without need to combine it. Fixes #12225
* Improved the exit code and error handling (#12219)
* No need to have the auto-service dependency in the client bindings (#12244)
* Deprecate all 'lift style' code (#12263)
* Minor spelling Fix (#12258)
* Adding ignore process match for IE Mode across bindings (#12279)
* Extract original driver from decorated driver when Augmenting a driver (#12248)
* BidiException instead of DevToolsException in getBiDi (#12284)
* [grid] Switching to fine log level when clearing caches in LocalNode
* Removing deprecated methods (findElement & findElements)
* less memory allocation (#12320)
* Add move to location method to Actions (#11509)
* [grid] Add supports for list-of-table options (#12363)
* [grid] reject requests only if it has been in the queue before trying… (#12336)
* [grid] do not rely on .hashCode for .equals (#12361)
* Use Selenium Manager to locate drivers on PATH (#12352)
* [grid] Improved the new session handling when the queue is empty (#12385)
* [grid] Using SM to find drivers on PATH
* Using same variable for log output, fixes #12406
* UnreachableBrowserException logs the command parameter details only in debug mode (#11328)
* Filter related fixed in the NettyClient and the JdkHttpClient
* Removing deprecated `createServiceWithConfig` in ChromeDriverService
* Removing deprecated `webdriver.chrome.whitelistedIps` in ChromeDriverService
* Removing deprecated ChromeDriverLogLevel
* Add browser output from Selenium Manager to options (#12424)
* [grid] Make user defined SlotMatcher used everywhere in grid code (#12240)
* Add support for FedCM commands (#12096)
* [grid] Returning se:bidi when the user sends `webSocketUrl`. Fixes #12314
* [grid] Covering use case where a Node is UP after being marked DOWN. Fixes #12116
* Make external modules static (#12294)
* Use double-checked locking to initialise the Selenium Manager instance
* Making sure browser path is not null before setting the binary when value is returned from SM
* Showing SM error when the exception is thrown

Từ phiên bản Selenium 4.11.0 thì Selenium Manager đã tự động cập nhật đường link mới của chromedriver (Chrome for Testing) nên không còn vấn đề support CDP sai phiên bản nữa và cũng không cần add file chromedriver.exe thủ công nữa.
What's new in Selenium Manager with Selenium 4.11.0

Trước đó 4.10.0 nó đang hiểu đường link cũ trỏ đến chromedriver của Google nên sẽ có câu chuyện không cập nhật đúng version browser. Giờ thì cập nhật rồi. Sự kết hợp giữa Chrome và Selenium lần này khá hay.

Chrome for Testing availability



v4.10.0

======
* Supported CDP versions: 85, 112, 113, 114
* Remove Selenium RC and WebDriverBackedSelenium code (#12024)
* Fixed URI in logs (#12000)
* Enhancing stereotype in Dynamic Grid (#12034)
* Support proxies in Selenium Manager (#12036)
* Close websockets when closing JDK HTTP Client (#12035)
* Change bidi loglevel warning level (#12054)
* Allow driving embedded apps without CDP (#11963)
* Fix possible freeze from incompatible HTTP responses (#12055)
* Fix bug when JSON max depth reached (#12056)
* Remove deprecated capabilities `SUPPORTS_JAVASCRIPT` and `SUPPORTS_WEB_STORAGE`
* Remove deprecated setters in `Rectangle`
* improve cleaning of upload and download directories (#12059)
* Fix redirect bug in JDK HTTP Client (#12070)
* Prevent grid from creating sessions that will time out in queue (#12014)
* Respect disabled pretty printing for arrays (#12079)
* Add support for WebView2 in Edge
* Allow setting savefile directory in Chrome when downloads are enabled (#12109)
* Add BiDi support for browing context events
* Enable BiDi functionality for Chromium browsers
* Improve "near" locator behavior (#11290)
* Do not send driver logs to console by default (#12136)
* Fix bug with GeckoDriver option for truncating log lines
* Do not log Selenium Manager details as INFO (#12145)
* Error messages link to Selenium documentation where supported
* Create NoSuchDriverException for referencing driver location problems

 

v4.9.1

======
* Supported CDP versions: 85, 111, 112, 113
* Typo in the "addArguments" method comment (#11945)
* Handling case where -1 is returned as statusCode (#11910)
* Adding remote-allow-origins argument only when the Java 11 http client is not used (#11949)
* Remove deprecated "version" JWP capability
* Remove deprecated "platform" JWP capability
* Remove deprecated "takesScreenshot" JWP capability
* Remove deprecated "unexpectedAlertBehaviour" JWP capability
* [grid] Displaying the real stereotype config at startup
* Add logging for starting the driver
* [grid] Do not switch and remove node in one iteration (#11961)
* Handle fragmented websocket messages (#11962)
* Add more logging to Selenium Manager (#11959)
* Make Driver Services consistent (#11973)
* Using driver path always for Safari and Safari Technology Preview (#11952)
* Overriding methods to have main platform names lowercase (#11952)

v4.9.0

Highlights


======
* Supported CDP versions: 85, 110, 111, 112
* Handle redirects inside the JdkHttpClient (#11816)
* [grid] Remove Json Wire Protocol support (#11823)
* Selenium Manager use binary from Browser Options
* [grid] Allowing binary to be set via options when not set in Grid
* Log exception message (#11922)
* [grid] Fixing remote execution for Edge when Java 8 client is used

v4.8.3

======
* Supported CDP versions: 85, 109, 110, 111
* Fix bug preventing adding items to ArrayList for Selenium Manager command

v4.8.2 (Mar 24, 2023)

======
* Supported CDP versions: 85, 109, 110, 111
* [grid] Enabling `detectDrivers` original behaviour.
* Fix NPE regression in 4.8.0 (#11701)
* Implement DriverFinder completely independent of Service classes (#11491)
* [grid] Allow LocalNode to be extended for customisation (#11718)
* InvalidSelectorException extends WebDriverException (#11727)
* Deprecate CDP instance methods in FirefoxDriver
* Adding allowHosts to GeckoDriverService
* [grid] Passing language env var to child containers
* [grid] Removing unknown capability extensions for IE
* [bidi] Ensure removing listeners does not cause an error
* Process Selenium Manager output as JSON (#11663)
* [grid] Support remote downloads in Grid (#11702)
* Adding `remote-allow-origins` for Chrome
* Invoking Selenium Manager only with `--browser
* [grid] Adding `remote-allow-origins` for Chrome stereotypes
* Overloaded constructors to configure connect and read timeouts for WebDriver objects (#11532)
 

v4.8.1 (Feb 17, 2023)

======
* Supported CDP versions: 85, 108, 109, 110
* Merge capabilities of slot with the new session request capabilities (#11369)
* Keep track of pinned scripts per CDP session (#11598)
* Simplify Augmentation for Basic Auth (#11601)
* Print requested capabilities in SessionNotCreatedException (#11604)
* Simplify Augmentation for Dom Mutation
* Generate a Maven BOM (#11560)
* Synchronize method to get Selenium Manager binary (fix #11620) (#11640)
* Updating Selenium Manager binaries for 4.8.1 release
* File downloads url - Adhere to w3c standards (#11646)

v4.8.0 (Jan 23, 2023)

======
* Supported CDP versions: 85, 107, 108, 109
* Implement Edge and Chrome Driver Services using log level with ChromiumDriverLogLevel enum
* Deprecate Edge Driver Service using log level with String
* Deprecate Chrome Driver Service using log level with ChromeDriverLogLevel enum
* Deprecate setting Chrome Driver Service logging values in Chrome Options
* Close BiDi session on closing the last top-level browsing context
* Add withAllowedListIps() to ChromeDriverService
* Add comment with name of large JS executions (#11038)
* Allow Pointer and Wheel methods to accept Point object (#11477)
* Fix bug where options are not properly merged into capabilities (#11396)
* JDKHttpClient: Fix null pointer bug when responseBody is null (#11450)
* CDP: Ensure child session is created under browser session (#11475)
* Deprecate setHeadless for Chrome and Firefox Options (#11467)
* Grid: Remove translations of non-w3c locators (#11470)
* JDKHttpClient: Handle RQST with no Body [POST/PUT] (#11445)
* Fix bug with decorated webdriver not calling the listeners (#11438)
* BiDi: Add filter parameter to LogInspector methods
* BiDi: Rename 'onConsoleLog' to 'onConsoleEntry'
* CDP: Fix bug with console events returning modified args (#11435)
* Grid: Accommodate ability to specify sub-paths (#11271)
* Grid: fix bug with pulling image using zero content-length (#11342)

Phiên bản Selenium 4.8.0 thì nó đã thay đổi trong chế độ Headless trong Chrome và Firefox và support CDP 109

Trước đây:
ChromeOptions options = new ChromeOptions();
options.setHeadless(true);
WebDriver driver = new ChromeDriver(options);
driver.get("https://anhtester.com");
driver.quit();​

Sau này:

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless=new");
WebDriver driver = new ChromeDriver(options);
driver.get("https://anhtester.com");
driver.quit();


Maven Dependency:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.8.0</version>
</dependency>​

v4.7.2 (Dec 13, 2022)

======
* Grid: Support file downloads on the node (#11277)
* Change chromium service names from whitelisted to allowed (#11409)
* Avoid closing CDP connection in browser implementation since that logic now sits in RemoteWebDriver (Fixes #11401)
* Fix bug where failing Selenium Manager method results in wrong error
* Allow changing chromium driver log timestamp formatting
* Allow ignoring chromedriver build checks using service builders
* Add support for appendLog to msedgedriver service
* Fix msedgedriver log level logic
* Allow setting chromedriver log level from system properties
* Fix chromedriver log level logic
* Remove deprecated Firefox capabilities
* Removing a few bits more of the magic that moves JWP to W3C
* Removing deprecated SUPPORTS_ALERTS and SUPPORTS_SQL_DATABASE caps
* Removing deprecated OVERLAPPING_CHECK_DISABLED cap
* Removing deprecated LOGGING_PREFS cap
* Removing deprecated HAS_TOUCHSCREEN cap
* Removing deprecated HAS_NATIVE_EVENTS cap
* Removing deprecated ENABLE_PROFILING_CAPABILITY cap
* Removing deprecated ACCEPT_SSL_CERTS cap

Cái mới tại phiên bản này là nó support appendLog cho msedgedriver

Maven Dependency:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.2</version>
</dependency>​


v4.7.1

======
* Supported CDP versions: 85, 106, 107, 108
* Add close method to JDK 11 client. Ensure close methods for Http client is called. (#11345)
* Don’t specify content length when pulling images (#11343)
* Allow arguments to be passed in Node flag "driver-configuration" (#11367)
* Ensure all states of StartOrDie are handled (#11297)

Maven Dependency:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.1</version>
</dependency>​​

v4.7.0

======
* Supported CDP versions: 85, 106, 107, 108
* Remove deprecated classes for Rotatable, AppCache, NetworkConnection, LocationContext
* Remove deprecated capabilities- IE_USE_PRE_PROCESS_PROXY, APPLICATION_NAME, ELEMENT_SCROLL_BEHAVIOR
* Fix bug causing sessions to hang when session stops (#11167)
* Support multiple reads of input stream (#11249)
* Fix reading connection header (#11255)
* BiDi: Implement JavascriptLogEntry
* BiDi: Support browsing context in event subscriptions
* BiDi: Fix type of JavascriptLogEntry
* Grid: improved exception handling when no cause is set (#11286)
* Fix following contract of Closeable (#11282)
* Grid: Get TZ from parent container when not passed as cap (#11289)
* BiDi: Add LogInspector
* Grid: do not offload from multiple threads to a single worker (#11260)
* Add support for Selenium Manager to work with IE Driver
* Improve error handling with Selenium Manager (#11300)
* BiDi: Add constructor parameter for commands without a response
* Grid: remove browser filters from makeW3CSafe
* Fix bug for merging MutableCapabilities and Options

Tại phiên bản này thì cái mới là Selenium Manager nó hỗ trợ cho IE Driver nhưng giờ thì IE cũng không còn được Microsoft support nên chắc cũng không ảnh hưởng mấy.
Chủ yếu là nó support cho Chromium đến version 108 

Maven Dependency:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.7.0</version>
</dependency>​​

v4.6.0

======
* Supported CDP versions: 85, 105, 106, 107
* Updated IllegalArgumentException to NullPointerException for Null Values in Require Class (#11162)
* Fix page ranges issue in PrintOptions (#11172) (#11174)
* Ensure the correct output stream is used (#11175)
* Add initial support for Selenium Manager
* Revert "[java] only allow enabled select lists for Select class"
* [grid] Closing input pipeline when 404 is returned
* JDK Http client - avoid chunking without buffering to memory (#11198)
* Avoiding pulling same netty dependencies for AsyncHttpClient
* [grid] Only check for IEDriver on Windows.

Chổ này có tính năng mới là từ phiên bản 4.6.0 trở về sau Selenium Manager nó tự động tải driver tương thích với phiên bản của Browser luôn mà chúng ta không cần dùng bên thư viện thứ 3 như WebDriverManager.

Maven Dependency:
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>4.6.0</version>
</dependency>​​
  • Anh Tester

    Đường dẫu khó chân vẫn cần bước đi
    Đời dẫu khổ tâm vẫn cần nghĩ thấu