From dde03fb6eccd483f0f16504742d3c3b129b795f8 Mon Sep 17 00:00:00 2001 From: ian zhang Date: Thu, 27 Feb 2025 21:35:05 +0800 Subject: [PATCH 1/2] update ie doc --- .../browsers/internet_explorer.zh-cn.md | 89 +++++++++++-------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md index 80b16de42e2c..4540be5acd4d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md @@ -1,31 +1,34 @@ --- -title: "IE specific functionality" +title: "IE 特定功能" linkTitle: "Internet Explorer" weight: 8 description: >- - These are capabilities and features specific to Microsoft Internet Explorer browsers. + 这些是 Microsoft Internet Explorer 浏览器特有的功能和特性. aliases: [ "/zh-cn/documentation/capabilities/internet_explorer" ] --- -As of June 2022, Selenium officially no longer supports standalone Internet Explorer. -The Internet Explorer driver still supports running Microsoft Edge in "IE Compatibility Mode." +自2022年6月起, Selenium 正式不再支持独立的 Internet Explorer. +Internet Explorer 驱动程序仍支持在 "IE 兼容模式" 下运行 Microsoft Edge. -## Special considerations +## 特别注意事项 -The IE Driver is the only driver maintained by the Selenium Project directly. -While binaries for both the 32-bit and 64-bit -versions of Internet Explorer are available, there are some -[known limitations](//jimevansmusic.blogspot.co.uk/2014/09/screenshots-sendkeys-and-sixty-four.html) -with the 64-bit driver. As such it is recommended to use the 32-bit driver. +IE 驱动程序是 Selenium 项目直接维护的唯一驱动程序. +虽然 32 位和 64 位版本的版本的二进制文件, +但有一些64位驱动程序的 +[已知限制](//jimevansmusic.blogspot.co.uk/2014/09/screenshots-sendkeys-and-sixty-four.html). +因此, 建议使用 32 位驱动程序. -Additional information about using Internet Explorer can be found on the -[IE Driver Server page]({{< ref "/documentation/ie_driver_server/" >}}) +有关使用 Internet Explorer 的其他信息, 请参见 +[IE 驱动程序服务器页面]({{< ref "/documentation/ie_driver_server/" >}}) -## Options +## 选项 + +在 Internet Explorer 兼容模式下启动 Microsoft Edge 浏览器, +并使用基本定义的选项, +看起来就像这样: -Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with basic defined options looks like this: {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -48,13 +51,14 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b {{< /tab >}} {{< /tabpane >}} -As of Internet Explorer Driver v4.5.0: -* If IE is not present on the system (default in Windows 11), you do not need to -use the two parameters above. IE Driver will use Edge and will automatically locate it. -* If IE and Edge are both present on the system, you only need to set attaching to Edge, -IE Driver will automatically locate Edge on your system. -So, if IE is not on the system, you only need: +截至 Internet Explorer 驱动程序 v4.5.0: +* 如果系统中没有 IE(Windows 11 中的默认设置), 则无需使用上述两个参数. + 使用上述两个参数.IE 驱动程序将使用 Edge, 并自动对其进行定位. +* 如果系统上同时存在 IE 和 Edge, 则只需设置附加到 Edge、 + IE 驱动程序将自动在系统中定位 Edge. + +因此, 如果系统中没有 IE, 您只需要: {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" text=true >}} @@ -82,7 +86,8 @@ val driver = InternetExplorerDriver(options) {{< /tab >}} {{< /tabpane >}} -Here are a few common use cases with different capabilities: + +以下是几种具有不同功能的常见用例: ### fileUploadDialogTimeout @@ -125,7 +130,7 @@ val driver = RemoteWebDriver(options) 此功能将清除InternetExplorer所有正在运行实例的 _缓存, 浏览器历史记录和Cookies_ (包括手动启动或由驱动程序启动的实例) . -默认情况下,此设置为 `false`. +默认情况下, 此设置为 `false`. 使用此功能将导致启动浏览器时性能下降, 因为驱动程序将等待直到缓存清除后再启动IE浏览器. @@ -216,7 +221,7 @@ val driver = RemoteWebDriver(options) 但是, 到目前为止, 这仍然是第二好的选择, 并且第一选择应该 *始终* 是手动实际设置每个区域的保护模式设置. -如果用户正在使用此属性, +如果用户正在使用此属性, 则只会给予 "尽力而为" 的支持. 此功能接受一个布尔值作为参数. @@ -495,18 +500,22 @@ fun main() { -## Service +## 服务 -Service settings common to all browsers are described on the [Service page]({{< ref "../drivers/service.md" >}}). +[Service page]({{< ref "../drivers/service.md" >}}) +描述了所有浏览器通用的服务设置. -### Log output +### 日志输出 -Getting driver logs can be helpful for debugging various issues. The Service class lets you -direct where the logs will go. Logging output is ignored unless the user directs it somewhere. +获取驱动程序日志有助于调试各种问题. +服务类可让您指示日志的去向. +除非用户指定了日志输出的位置, +否则日志输出将被忽略. -#### File output +#### 文件输出 + +更改日志输出以保存到特定文件: -To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} @@ -534,9 +543,12 @@ Property value: String representing path to log file {{< /tab >}} {{< /tabpane >}} -#### Console output +#### 控制台输出 + + +要更改日志输出, 使其在控制台中显示为标准输出: + -To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} @@ -565,9 +577,12 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{< /tabpane >}} -### Log Level -There are 6 available log levels: `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, and `TRACE` -If logging output is specified, the default level is `FATAL` + +### 日志级别 +有 6 种可用的日志级别:`FATAL`、`ERROR`、`WARN`、`INFO`、`DEBUG` 和 `TRACE` +如果指定了日志输出, 默认级别为`FATAL`. + + {{< tabpane text=true >}} {{% tab header="Java" %}} @@ -594,7 +609,9 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t {{< /tab >}} {{< /tabpane >}} -### Supporting Files Path + +### 辅助文件路径 + {{< tabpane text=true >}} {{< tab header="Java" >}} From 256d1666b14039763b233777e8431b8d8b31e53b Mon Sep 17 00:00:00 2001 From: ian zhang Date: Sat, 1 Mar 2025 17:13:40 +0800 Subject: [PATCH 2/2] Update --- .../webdriver/bidi/_index.zh-cn.md | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/website_and_docs/content/documentation/webdriver/bidi/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/_index.zh-cn.md index 79eab30df335..92e60f8d5cfc 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/_index.zh-cn.md @@ -1,5 +1,5 @@ --- -title: "BiDirectional functionality" +title: "双向功能" linkTitle: "BiDi" weight: 16 aliases: [ @@ -12,23 +12,27 @@ aliases: [ ] --- -BiDirectional means that communication is happening in two directions simultaneously. -The traditional WebDriver model involves strict request/response commands which only allows for communication to -happen in one direction at any given time. In most cases this is what you want; it ensures that the browser is -doing the expected things in the right order, but there are a number of interesting things that can be done with -asynchronous interactions. -This functionality is currently available in a limited fashion with the [Chrome DevTools Protocol] (CDP), -but to address some of its drawbacks, the Selenium team, along with the major -browser vendors, have worked to create the new [WebDriver BiDi Protocol](https://w3c.github.io/webdriver-bidi/). -This specification aims to create a stable, cross-browser API that leverages bidirectional -communication for enhanced browser automation and testing functionality, -including streaming events from the user agent to the controlling software via WebSockets. -Users will be able to listen for and record or manipulate events as they happen during the course of a Selenium session. +双向是指通信同时在两个方向上进行. +传统的 WebDriver 模型涉及严格的请求/响应命令, +在任何时候都只允许单向通信. +在大多数情况下, 这正是您想要的;它能确保浏览器以正确的顺序执行预期的操作, +但异步交互也有许多有趣的地方. -### Enabling BiDi in Selenium -In order to use WebDriver BiDi, setting the capability in the browser options will enable the required functionality: +目前, [Chrome DevTools Protocol] (CDP) 可以有限地提供这种功能, +但为了解决它的一些缺点, +Selenium 团队与主要浏览器供应商一起创建了新的 [WebDriver BiDi 协议](https://w3c.github.io/webdriver-bidi/). +该规范旨在创建一个稳定的跨浏览器 API, +利用双向通信增强浏览器自动化和测试功能、 +包括通过 WebSockets 从用户代理到控制软件的流式事件. +用户将能在 Selenium 会话过程中监听、记录或操作事件. + + +### 在Selenium中启用 BiDi + +为了使用 WebDriver BiDi, +在浏览器选项中设置该功能将启用所需的功能: {{< tabpane langEqualsHeader=true >}} {{< tab header="Java" >}} @@ -51,17 +55,25 @@ options.setCapability("webSocketUrl", true); {{< /tab >}} {{< /tabpane >}} -This enables the WebSocket connection for bidirectional communication, -unlocking the full potential of the WebDriver BiDi protocol. -Note that Selenium is updating its entire implementation from WebDriver Classic to WebDriver BiDi (while -maintaining backwards compatibility as much as possible), but this section of documentation focuses on the new -functionality that bidirectional communication allows. -The low-level BiDi domains will be accessible in the code to the end user, but the goal is to provide -high-level APIs that are straightforward methods of real-world use cases. As such, the low-level -components will not be documented, and this section will focus only on the user-friendly -features that we encourage users to take advantage of. -If there is additional functionality you'd like to see, please raise a -[feature request](https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=&template=feature.md). +这将启用用于双向通信的 WebSocket 连接、 +释放 WebDriver BiDi 协议的全部潜能. + + + +请注意, Selenium 正在将其整个实现从 WebDriver Classic +升级到 WebDriver BiDi (同时尽可能保持向后兼容性) , +但本部分文档的重点是双向通信所允许的新功能. + + + +终端用户可以在代码中访问低级 BiDi 域, +但我们的目标是提供高级应用程序接口, +这些应用程序接口是真实世界用例的直接方法. +因此, 我们将不对底层组件进行记录, 本节将只关注我们鼓励使用者利用的用户友好功能. + + +如果您希望看到其他功能, 请提出 +[功能请求](https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=&template=feature.md).