From bf4c9c086de066249904048d260f4b61f83b0c25 Mon Sep 17 00:00:00 2001 From: Ian Date: Thu, 5 Mar 2020 00:01:48 +0800 Subject: [PATCH] Add Chinese translation of "shared_capabilities" - driver_idiosyncrasies/shared_capabilities.zh-cn.md --- .../shared_capabilities.zh-cn.md | 31 ++++++------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/docs_source_files/content/driver_idiosyncrasies/shared_capabilities.zh-cn.md b/docs_source_files/content/driver_idiosyncrasies/shared_capabilities.zh-cn.md index 4e654234f874..657bcb438d70 100644 --- a/docs_source_files/content/driver_idiosyncrasies/shared_capabilities.zh-cn.md +++ b/docs_source_files/content/driver_idiosyncrasies/shared_capabilities.zh-cn.md @@ -1,28 +1,17 @@ --- -title: "Shared capabilities" +title: "共享的功能" weight: 1 --- + +### 页面加载策略 +通过URL导航到新页面时,默认情况下,Selenium将等待页面完全加载后再进行响应。这对于初学者来说效果很好,但是在加载大量第三方资源的页面上可能会导致较长的等待时间。在这种情况下,使用非默认策略可以使测试的执行速度更快,但是也可能导致不稳定,即页面上的元素随元素加载和大小变化而改变位置. -{{% notice info %}} - 页面需要从英语翻译为简体中文。 -您熟悉英语与简体中文吗?帮助我们翻译它,通过 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 | \ No newline at end of file +| normal | complete | 默认情况下使用,等待所有资源下载完成 | +| eager | interactive | DOM访问已准备就绪,但其他资源(如图像)可能仍在加载中 | +| none | Any | 完全不阻塞WebDriver| \ No newline at end of file