From acb99f8a534af3552a05ffe79d66da029edd0d09 Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 6 Mar 2020 00:32:34 +0800 Subject: [PATCH] Add Chinese translation of "working_with_select_elements" - support_packages/working_with_select_elements.zh-cn.md --- .../working_with_select_elements.zh-cn.md | 39 +++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/docs_source_files/content/support_packages/working_with_select_elements.zh-cn.md b/docs_source_files/content/support_packages/working_with_select_elements.zh-cn.md index ed2817679d8d..63902102f653 100644 --- a/docs_source_files/content/support_packages/working_with_select_elements.zh-cn.md +++ b/docs_source_files/content/support_packages/working_with_select_elements.zh-cn.md @@ -1,17 +1,12 @@ --- -title: "Working with select elements" +title: "同选择元素一起工作" weight: 3 --- - -{{% notice info %}} - 页面需要从英语翻译为简体中文。 -您熟悉英语与简体中文吗?帮助我们翻译它,通过 pull requests 给我们! -{{% /notice %}} - -Select elements can require quite a bit of boiler plate code to automate. -To reduce this and make your tests cleaner, there is a -`Select` class in the Selenium support package. -To use it, you will need the following import statement: + +选择元素可能需要大量样板代码才能自动化. +为了减少这种情况并使您的测试更干净, 在Selenium的support包中有一个 +`Select` 类. +要使用它,您将需要以下导入语句: {{< code-tab >}} {{< code-panel language="java" >}} @@ -34,8 +29,7 @@ import org.openqa.selenium.support.ui.Select {{< / code-panel >}} {{< / code-tab >}} -You are then able to create a Select object using a WebElement that -references a `` 元素,基于WebElement创建一个Select对象。 {{< code-tab >}} {{< code-panel language="java" >}} @@ -63,10 +57,8 @@ val selectObject = new Select(selectElement) {{< / code-panel >}} {{< / code-tab >}} -The Select object will now give you a series of commands -that allow you to interact with a `` element. +Select对象现在将为您提供一系列命令,使您可以与 `` 元素中选择一个选项. ```html ` element. ``` -There are three ways to select the first option from the above element: +有三种方法可以从上述元素中选择第一个选项: {{< code-tab >}} {{< code-panel language="java" >}} @@ -134,7 +126,7 @@ selectObject.selectByVisibleText("Bread") {{< / code-panel >}} {{< / code-tab >}} -You can then check which options are selected by using: +然后,您可以检视所有被选择的选项: {{< code-tab >}} {{< code-panel language="java" >}} @@ -174,8 +166,7 @@ val firstSelectedOption = selectObject.firstSelectedOption {{< / code-tab >}} -Or you may just be interested in what `