Skip to content

Commit b949b93

Browse files
alaahongharsha509
andauthored
Add Chinese translation of "page_loading_strategy" (#359)
- webdriver/page_loading_strategy.zh-cn.md Co-authored-by: Sri Harsha <[email protected]>
1 parent 60dfc2a commit b949b93

File tree

1 file changed

+41
-28
lines changed

1 file changed

+41
-28
lines changed

docs_source_files/content/webdriver/page_loading_strategy.zh-cn.md

+41-28
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
11
---
2-
title: "Page loading strategy"
2+
title: "页面加载策略"
33
weight: 8
44
---
55

6-
Defines the current session's page loading strategy.
7-
By default, when Selenium WebDriver loads a page,
8-
it follows the _normal_ pageLoadStrategy.
9-
It is always recommended to stop downloading additional
10-
resources (like images, css, js) when the page loading takes lot of time.
6+
定义当前会话的页面加载策略.
7+
默认情况下, 当Selenium WebDriver加载页面时,
8+
遵循 _normal_ 的页面加载策略.
9+
始终建议您在页面加载缓慢时,
10+
停止下载其他资源 (例如图片, css, js) .
1111

12-
The `document.readyState` property of a document describes the loading state of the current document.
13-
By default, WebDriver will hold off on responding to a `driver.get()` (or) `driver.navigate().to()`
14-
call until the document ready state is `complete`
1512

16-
In SPA applications (like Angular, react, Ember) once the dynamic content
17-
is already loaded (I.e once the pageLoadStrategy status is COMPLETE),
18-
clicking on a link or performing some action within the page will not make a new request
19-
to the server as the content is dynamically loaded at the client side without a pull page refresh.
13+
`document.readyState` 属性描述当前页面的加载状态.
14+
默认情况下, 在页面就绪状态是 `complete` 之前,
15+
WebDriver都将延迟 `driver.get()` 的响应或
16+
`driver.navigate().to()` 的调用.
2017

21-
SPA applications can load many views dynamically
22-
without any server requests, So pageLoadStrategy
23-
will always show `COMPLETE` status until
24-
we do a new `driver.get()` and `driver.naviagte().to()`
2518

26-
WebDriver _pageLoadStrategy_ supports the following values:
19+
在单页应用程序中 (例如Angular, react, Ember) ,
20+
一旦动态内容加载完毕 (即pageLoadStrategy状态为COMPLETE) ,
21+
则点击链接或在页面内执行某些操作的行为将不会向服务器发出新请求,
22+
因为内容在客户端动态加载,
23+
无需刷新页面.
24+
25+
26+
单页应用程序可以动态加载许多视图,
27+
而无需任何服务器请求,
28+
因此页面加载策略将始终显示为 `COMPLETE` 的状态,
29+
直到我们执行新的 `driver.get()``driver.naviagte().to()` 为止.
30+
31+
32+
WebDriver的 _页面加载策略_ 支持以下内容:
2733

2834
## normal
2935

30-
This will make Selenium WebDriver to wait for the entire page is loaded.
31-
When set to **normal**, Selenium WebDriver waits until the
32-
[load](https://developer.mozilla.org/zh-CN/docs/Web/Events/load) event fire is returned.
36+
此配置使Selenium WebDriver等待整个页面的加载.
37+
设置为 **normal** 时,
38+
Selenium WebDriver将保持等待, 直到
39+
返回 [load](https://developer.mozilla.org/zh-CN/docs/Web/Events/load) 事件
40+
3341

34-
By default **normal** is set to browser if none is provided.
42+
默认情况下, 如果未设置页面加载策略,
43+
则设置 **normal** 为初始策略.
3544

3645
{{< code-tab >}}
3746
{{< code-panel language="java" >}}
@@ -123,12 +132,16 @@ fun main() {
123132

124133
## eager
125134

126-
This will make Selenium WebDriver to wait until the
127-
initial HTML document has been completely loaded and parsed,
128-
and discards loading of stylesheets, images and subframes.
135+
这将使Selenium WebDriver保持等待,
136+
直到完全加载并解析了HTML文档,
137+
该策略无关样式表, 图片和subframes的加载.
138+
139+
设置为 **eager** 时,
140+
Selenium WebDriver保持等待,
141+
直至返回
142+
[DOMContentLoaded](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/DOMContentLoaded_event)
143+
事件.
129144

130-
When set to **eager**, Selenium WebDriver waits until
131-
[DOMContentLoaded](https://developer.mozilla.org/zh-CN/docs/Web/API/Document/DOMContentLoaded_event) event fire is returned.
132145

133146
{{< code-tab >}}
134147
{{< code-panel language="java" >}}
@@ -227,7 +240,7 @@ fun main() {
227240

228241
## none
229242

230-
When set to **none** Selenium WebDriver only waits until the initial page is downloaded.
243+
设置为 **none** 时, Selenium WebDriver仅等待至初始页面下载完成.
231244

232245
{{< code-tab >}}
233246
{{< code-panel language="java" >}}

0 commit comments

Comments
 (0)