Skip to content

Commit 70cb79c

Browse files
authored
Update Chinese translation of "chrome_devtools" and "bidirectional" (SeleniumHQ#885)[deploy site]
* Update Chinese translation of "chrome_devtools" and "bidirectional" * Update Chinese translation of "chrome_devtools" -- Change all webdriver as WebDriver -- Fix typo as WebSockets
1 parent 1ab3db2 commit 70cb79c

File tree

5 files changed

+59
-55
lines changed

5 files changed

+59
-55
lines changed

website_and_docs/content/documentation/webdriver/bidirectional/_index.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ functionality useful for both browser automation generally and testing specifica
1515
Before now, users seeking this functionality have had to rely on
1616
with all of its frustrations and limitations.
1717

18-
The traditional webdriver model of strict request/response commands will be supplemented
18+
The traditional WebDriver model of strict request/response commands will be supplemented
1919
with the ability to stream events from the user agent to the controlling software via WebSockets,
2020
better matching the evented nature of the browser DOM.
2121

website_and_docs/content/documentation/webdriver/bidirectional/_index.ja.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ functionality useful for both browser automation generally and testing specifica
1515
Before now, users seeking this functionality have had to rely on
1616
with all of its frustrations and limitations.
1717

18-
The traditional webdriver model of strict request/response commands will be supplemented
18+
The traditional WebDriver model of strict request/response commands will be supplemented
1919
with the ability to stream events from the user agent to the controlling software via WebSockets,
2020
better matching the evented nature of the browser DOM.
2121

website_and_docs/content/documentation/webdriver/bidirectional/_index.pt-br.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ functionality useful for both browser automation generally and testing specifica
1515
Before now, users seeking this functionality have had to rely on
1616
with all of its frustrations and limitations.
1717

18-
The traditional webdriver model of strict request/response commands will be supplemented
18+
The traditional WebDriver model of strict request/response commands will be supplemented
1919
with the ability to stream events from the user agent to the controlling software via WebSockets,
2020
better matching the evented nature of the browser DOM.
2121

Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
---
2-
title: "双向功能"
3-
linkTitle: "双向"
2+
title: "双向协议"
3+
linkTitle: "双向协议"
44
weight: 16
55
aliases: [
66
"/documentation/zh-cn/webdriver/bidi_apis/",
77
"/zh-cn/documentation/webdriver/bidi_apis/"
88
]
99
---
1010

11-
Selenium is working with browser vendors to create the
12-
[WebDriver BiDirectional Protocol](https://w3c.github.io/webdriver-bidi/)
13-
as a means to provide a stable, cross-browser API that uses the bidirectional
14-
functionality useful for both browser automation generally and testing specifically.
15-
Before now, users seeking this functionality have had to rely on
16-
with all of its frustrations and limitations.
11+
Selenium正在与浏览器供应商合作创建
12+
[WebDriver双向协议](https://w3c.github.io/webdriver-bidi/) ,
13+
作为一种提供稳定的跨浏览器API的方法,
14+
该API使用双向协议处理
15+
各种浏览器的通用自动化以及特定测试的需求.
16+
在此之前, 寻求此功能的用户
17+
必须忍受当前实现的全部问题和局限.
1718

18-
The traditional webdriver model of strict request/response commands will be supplemented
19-
with the ability to stream events from the user agent to the controlling software via WebSockets,
20-
better matching the evented nature of the browser DOM.
2119

22-
Because it's a bad idea to tie your tests to a specific version of a specific browser,
23-
the Selenium project recommends using WebDriver BiDi wherever possible.
24-
However, until the spec is complete there are many useful things that the CDP offers.
25-
To help keep your tests independent and portable, Selenium offers some useful helper classes.
26-
At the moment, these use the CDP, but when we shall be using WebDriver Bidi as soon as possible
20+
严格限制请求响应命令的传统WebDriver模型,
21+
将从user agent转变为基于WebSockets的软件控制,
22+
通过这样完善流事件的能力,
23+
以便更好地匹配浏览器DOM的事件性质.
24+
25+
因为将测试受限于特定浏览器的特定版本是个坏主意,
26+
Selenium项目建议尽可能使用WebDriver BiDi.
27+
然而, 在规范完成之前, CDP提供了许多有用的东西.
28+
为了帮助保持测试的独立性和可移植性,
29+
Selenium提供了一些有用的辅助类.
30+
目前, 这些应用程序使用CDP,
31+
但我们将尽快提供WebDriver Bidi的实现.

website_and_docs/content/documentation/webdriver/bidirectional/chrome_devtools.zh-cn.md

+35-36
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,36 @@ aliases: [
1010

1111
{{% pageinfo color="warning" %}}
1212
<p class="lead">
13-
<i class="fas fa-language display-4"></i>
14-
Page being translated from English to Chinese.
15-
Do you speak Chinese? Help us to translate
16-
it by sending us pull requests!
13+
虽然Selenium 4提供了对Chrome DevTools Protocol (CDP) 的直接访问,
14+
但是仍非常鼓励您使用
15+
[WebDriver Bidi APIs]({{< ref "bidi_api.md" >}}
16+
代替.
1717
</p>
1818
{{% /pageinfo %}}
1919

20-
{{% pageinfo color="warning" %}}
21-
<p class="lead">
22-
While Selenium 4 provides direct access to the Chrome DevTools Protocol (CDP), it is
23-
highly encouraged that you use the
24-
[WebDriver Bidi APIs]({{< ref "bidi_api.md" >}} instead.
25-
</p>
26-
{{% /pageinfo %}}
27-
28-
Many browsers provide "DevTools" -- a set of tools that are integrated with the browser that
29-
developers can use to debug web apps and explore the performance of their pages. Google Chrome's
30-
DevTools make use of a protocol called the Chrome DevTools Protocol (or "CDP" for short).
31-
As the name suggests, this is not designed for testing, nor to have a stable API, so functionality
32-
is highly dependent on the version of the browser.
33-
34-
WebDriver Bidi is the next generation of the W3C WebDriver protocol and aims to provide a stable API
35-
implemented by all browsers, but it's not yet complete. Until it is, Selenium provides access to
36-
the CDP for those browsers that implement it (such as Google Chrome, or Microsoft Edge, and
37-
Firefox), allowing you to enhance your tests in interesting ways. Some examples of what you can
38-
do with it are given below.
39-
40-
## Emulate Geo Location
41-
42-
Some applications have different features and functionalities across different
43-
locations. Automating such applications is difficult because it is hard to emulate
44-
the geo-locations in the browser using Selenium. But with the help of Devtools,
45-
we can easily emulate them. Below code snippet demonstrates that.
20+
许多浏览器都提供"开发工具" -- 一组与浏览器集成的工具,
21+
开发人员可以用其调试web应用程序并探索其页面的性能.
22+
谷歌浏览器开发工具
23+
使用一种称为Chrome DevTools Protocol (简称"CDP") 的协议.
24+
顾名思义, 这不是为测试而设计的,
25+
而并没有一个稳定的API,
26+
所以它的功能高度依赖于浏览器的版本.
27+
28+
WebDriver Bidi是W3C WebDriver的下一代协议,
29+
旨在提供由所有浏览器实现稳定的API, 但尚未完成.
30+
在此之前, Selenium提供了通过CDP实现的方式
31+
(诸如Google Chrome或Microsoft Edge, 以及Firefox),
32+
允许您以有趣的方式增强测试.
33+
下面给出了实际使用的例子.
34+
35+
## 模拟地理位置
36+
37+
一些应用程序在不同的位置具有不同的特性和功能.
38+
自动化此类应用程序很难,
39+
因为很难使用Selenium在浏览器中模拟地理位置.
40+
但是在Devtools的帮助下,
41+
我们可以轻易模拟他们.
42+
下面的代码片段演示了这一点.
4643

4744
{{< tabpane langEqualsHeader=true >}}
4845
{{< tab header="Java" >}}
@@ -159,7 +156,7 @@ fun main() {
159156
{{< /tab >}}
160157
{{< /tabpane >}}
161158

162-
## Emulate Geo Location with the Remote WebDriver:
159+
## 通过远程WebDriver模拟地理位置
163160

164161
{{< tabpane langEqualsHeader=true >}}
165162
{{< tab header="Java" >}}
@@ -316,12 +313,14 @@ fun main() {
316313
{{< /tab >}}
317314
{{< /tabpane >}}
318315

319-
## Override Device Mode
316+
## 覆盖设备模式
320317

321-
Using Selenium's integration with CDP, one can override the current device
322-
mode and simulate a new mode. Width, height, mobile, and deviceScaleFactor
323-
are required parameters. Optional parameters include scale, screenWidth,
324-
screenHeight, positionX, positionY, dontSetVisible, screenOrientation, viewport, and displayFeature.
318+
使用Selenium与CDP的集成,
319+
可以覆盖当前设备模式并模拟新模式.
320+
Width, height, mobile和deviceScaleFactor是必需的参数.
321+
可选参数包括scale, screenWidth,
322+
screenHeight, positionX, positionY,
323+
dontSetVisible, screenOrientation, viewport和displayFeature.
325324

326325
{{< tabpane langEqualsHeader=true >}}
327326
{{< tab header="Java" >}}

0 commit comments

Comments
 (0)