Skip to content

Add Chinese translation of "shared_capabilities" #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
---
title: "Shared capabilities"
title: "共享的功能"
weight: 1
---

### 页面加载策略
通过URL导航到新页面时,默认情况下,Selenium将等待页面完全加载后再进行响应。这对于初学者来说效果很好,但是在加载大量第三方资源的页面上可能会导致较长的等待时间。在这种情况下,使用非默认策略可以使测试的执行速度更快,但是也可能导致不稳定,即页面上的元素随元素加载和大小变化而改变位置.

{{% notice info %}}
<i class="fas fa-language"></i> 页面需要从英语翻译为简体中文。
您熟悉英语与简体中文吗?帮助我们翻译它,通过 pull requests 给我们!
{{% /notice %}}

### pageLoadStrategy
When navigating to a new page via URL, by default Selenium will wait
until the page has fully loaded before responding. This works well for
beginners, but can cause long wait times on pages that load a large
number of third party resources. Using a non default strategy can make
test execution faster in cases like this, but can also introduce flakiness
where elements on the page change position as elements load in and change
size.

The page load strategy queries the
页面加载策略可以参考链接
[document.readyState](//developer.mozilla.org/en-US/docs/Web/API/Document/readyState)
as described in the table below:
如下述表格的描述:

| Strategy | Ready State | Notes |
| 策略 | 准备完成的状态 | 备注 |
| -------- | ----------- | ----- |
| normal | complete | Used by default, waits for all resources to download |
| eager | interactive | DOM access is ready, but other resources like images may still be loading |
| none | Any | Does not block WebDriver at all |
| normal | complete | 默认情况下使用,等待所有资源下载完成 |
| eager | interactive | DOM访问已准备就绪,但其他资源(如图像)可能仍在加载中 |
| none | Any | 完全不阻塞WebDriver|