Skip to content

Commit 0b46eb2

Browse files
jmartinezpoqdiemol
andauthored
Translate working with select elements to spanish (#346) [deploy site]
Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
1 parent 6b92e33 commit 0b46eb2

File tree

1 file changed

+77
-80
lines changed

1 file changed

+77
-80
lines changed

docs_source_files/content/support_packages/working_with_select_elements.es.md

Lines changed: 77 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@ title: "Trabajando con elementos select"
33
weight: 3
44
---
55

6-
{{% notice info %}}
7-
<i class="fas fa-language"></i> Page being translated from
8-
English to Spanish. Do you speak Spanish? Help us to translate
9-
it by sending us pull requests!
10-
{{% /notice %}}
116

12-
13-
Select elements can require quite a bit of boiler plate code to automate.
14-
To reduce this and make your tests cleaner, there is a
15-
`Select` class in the Selenium support package.
16-
To use it, you will need the following import statement:
7+
A la hora de seleccionar elementos puede ser necesario código repetitivo
8+
para poder ser automatizado.
9+
Para reducir esto y hacer tus test mas limpios, existe un clase _Select_ en los
10+
paquetes de soporte de Selenium.
11+
Para usarla, necesitarás importarla de la siguiente forma:
1712

1813
{{< code-tab >}}
1914
{{< code-panel language="java" >}}
@@ -29,15 +24,15 @@ using OpenQA.Selenium.Support.UI
2924
include Selenium::WebDriver::Support
3025
{{< / code-panel >}}
3126
{{< code-panel language="javascript" >}}
32-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
27+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
3328
{{< / code-panel >}}
3429
{{< code-panel language="kotlin" >}}
3530
import org.openqa.selenium.support.ui.Select
3631
{{< / code-panel >}}
3732
{{< / code-tab >}}
3833

39-
You are then able to create a Select object using a WebElement that
40-
references a `<select>` element.
34+
Una vez importado, ya podrás crear un objeto _Select_ usando un WebElement que
35+
referencie a un elemento `<select>`.
4136

4237
{{< code-tab >}}
4338
{{< code-panel language="java" >}}
@@ -57,18 +52,18 @@ select_element = driver.find_element(id: 'selectElementID')
5752
select_object = Select(select_element)
5853
{{< / code-panel >}}
5954
{{< code-panel language="javascript" >}}
60-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
55+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
6156
{{< / code-panel >}}
6257
{{< code-panel language="kotlin" >}}
6358
val selectElement = driver.findElement(By.id("selectElementID"))
6459
val selectObject = new Select(selectElement)
6560
{{< / code-panel >}}
6661
{{< / code-tab >}}
6762

68-
The Select object will now give you a series of commands
69-
that allow you to interact with a `<select>` element.
70-
First of all, there are different ways of selecting an option
71-
from the `<select>` element.
63+
El objeto _Select_ te proporcionará una serie de comandos que te permitirán
64+
interactuar con los elementos `<select>`.
65+
Lo primero de todo, existen diferentes formas de seleccionar una opción de un
66+
elemento `<select>`.
7267

7368
```html
7469
<select>
@@ -78,208 +73,210 @@ from the `<select>` element.
7873
</select>
7974
```
8075

81-
There are three ways to select the first option from the above element:
76+
Existen tres formas de seleccionar la primera opción del ejemplo que se muestra
77+
arriba.
8278

8379
{{< code-tab >}}
8480
{{< code-panel language="java" >}}
85-
// Select an <option> based upon the <select> element's internal index
81+
// Selecciona una <option> basándose en el indice interno del elemento <select>
8682
selectObject.selectByIndex(1);
8783

88-
// Select an <option> based upon its value attribute
84+
// Selecciona una <option> basándose en su atributo value
8985
selectObject.selectByValue("value1");
9086

91-
// Select an <option> based upon its text
87+
// Selecciona una <option> basándose en el texto que muestra
9288
selectObject.selectByVisibleText("Bread");
9389
{{< / code-panel >}}
9490
{{< code-panel language="python" >}}
95-
# Select an <option> based upon the <select> element's internal index
91+
# Selecciona una <option> basándose en el indice interno del elemento <select>
9692
select_object.select_by_index(1)
9793

98-
# Select an <option> based upon its value attribute
94+
# Selecciona una <option> basándose en su atributo value
9995
select_object.select_by_value('value1')
10096

101-
# Select an <option> based upon its text
97+
# Selecciona una <option> basándose en el texto que muestra
10298
select_object.select_by_visible_text('Bread')
10399
{{< / code-panel >}}
104100
{{< code-panel language="csharp" >}}
105-
// Select an <option> based upon the <select> element's internal index
101+
// Selecciona una <option> basándose en el indice interno del elemento <select>
106102
selectObject.SelectByIndex(1);
107103

108-
// Select an <option> based upon its value attribute
104+
// Selecciona una <option> basándose en su atributo value
109105
selectObject.SelectByValue("value1");
110106

111-
// Select an <option> based upon its text
112-
selectObject.SelectByText("Bread");
107+
// Selecciona una <option> basándose en el texto que muestra
108+
selectObject.SelectByText("Bread");
113109
{{< / code-panel >}}
114110
{{< code-panel language="ruby" >}}
115-
# Select an <option> based upon the <select> element's internal index
111+
# Selecciona una <option> basándose en el indice interno del elemento <select>
116112
select_object.select_by(:index, 1)
117113

118-
# Select an <option> based upon its value attribute
114+
# Selecciona una <option> basándose en su atributo value
119115
select_object.select_by(:value, 'value1')
120116

121-
# Select an <option> based upon its text
117+
# Selecciona una <option> basándose en el texto que muestra
122118
select_object.select_by(:text, 'Bread')
123119
{{< / code-panel >}}
124120
{{< code-panel language="javascript" >}}
125-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
121+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
126122
{{< / code-panel >}}
127123
{{< code-panel language="kotlin" >}}
128-
// Select an <option> based upon the <select> element's internal index
124+
// Selecciona una <option> basándose en el indice interno del elemento <select>
129125
selectObject.selectByIndex(1)
130126

131-
// Select an <option> based upon its value attribute
127+
// Selecciona una <option> basándose en su atributo value
132128
selectObject.selectByValue("value1")
133129

134-
// Select an <option> based upon its text
130+
// Selecciona una <option> basándose en el texto que muestra
135131
selectObject.selectByVisibleText("Bread")
136132
{{< / code-panel >}}
137133
{{< / code-tab >}}
138134

139-
You can then check which options are selected by using:
135+
Puedes revisar que opciones están seleccionadas usando:
140136

141137
{{< code-tab >}}
142138
{{< code-panel language="java" >}}
143-
// Return a List<WebElement> of options that have been selected
139+
// Devuelve una Lista de <WebElements> con las opciones que han sido seleccionadas
144140
List<WebElement> allSelectedOptions = selectObject.getAllSelectedOptions();
145141

146-
// Return a WebElement referencing the first selection option found by walking down the DOM
142+
// Devuelve un WebElement que referencia a la primera opción seleccionada que se encontró en el DOM
147143
WebElement firstSelectedOption = selectObject.getFirstSelectedOption();
148144
{{< / code-panel >}}
149145
{{< code-panel language="python" >}}
150-
# Return a list[WebElement] of options that have been selected
146+
# Devuelve una Lista de [WebElements] con las opciones que han sido seleccionadas
151147
all_selected_options = select_object.all_selected_options
152148

153-
# Return a WebElement referencing the first selection option found by walking down the DOM
149+
# Devuelve un WebElement que referencia a la primera opción seleccionada que se encontró en el DOM
154150
first_selected_option = select_object.first_selected_option
155151
{{< / code-panel >}}
156152
{{< code-panel language="csharp" >}}
157-
// We don't have a C# code sample yet - Help us out and raise a PR
153+
// No disponemos del ejemplo de código en C# aun - Ayudanos a ello abriendo un PR
158154
{{< / code-panel >}}
159155
{{< code-panel language="ruby" >}}
160-
# Return an Array[Element] of options that have been selected
156+
# Devuelve un Array de <WebElements> con las opciones que han sido seleccionadas
161157
all_selected_options = select_object.selected_options
162158

163-
# Return a WebElement referencing the first selection option found by walking down the DOM
159+
# Devuelve un WebElement que referencia a la primera opción seleccionada que se encontró en el DOM
164160
first_selected_option = select_object.first_selected_option
165161
{{< / code-panel >}}
166162
{{< code-panel language="javascript" >}}
167-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
163+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
168164
{{< / code-panel >}}
169165
{{< code-panel language="kotlin" >}}
170-
// Return a List<WebElement> of options that have been selected
166+
// Devuelve una Lista de <WebElements> con las opciones que han sido seleccionadas
171167
val allSelectedOptions = selectObject.allSelectedOptions
172168

173-
// Return a WebElement referencing the first selection option found by walking down the DOM
169+
// Devuelve un WebElement que referencia a la primera opción seleccionada que se encontró en el DOM
174170
val firstSelectedOption = selectObject.firstSelectedOption
175171
{{< / code-panel >}}
176172
{{< / code-tab >}}
177173

178174

179-
Or you may just be interested in what `<option>` elements
180-
the `<select>` element contains:
175+
Tambien existe una forma de obtener que elementos `<option>` contiene un
176+
`<select>`:
181177

182178
{{< code-tab >}}
183179
{{< code-panel language="java" >}}
184-
// Return a List<WebElement> of options that the <select> element contains
180+
// Devuelve una lista de <WebElements> que contiene las opciones de un elemento <select>
185181
List<WebElement> allAvailableOptions = selectObject.getOptions();
186182
{{< / code-panel >}}
187183
{{< code-panel language="python" >}}
188-
# Return a list[WebElement] of options that the &lt;select&gt; element contains
184+
# Devuelve una lista de [WebElements] que contiene las opciones de un elemento &lt;select&gt;
189185
all_available_options = select_object.options
190186
{{< / code-panel >}}
191187
{{< code-panel language="csharp" >}}
192-
// Return a IList<IWebElement> of options that the <select> element contains
188+
// Devuelve una IList de <IWebElements> que contiene las opciones de un elemento <select>
193189
IList<IWebElement> allAvailableOptions = selectObject.Options;
194190
{{< / code-panel >}}
195191
{{< code-panel language="ruby" >}}
196-
# Return an Array[Element] of options that the &lt;select&gt; element contains
192+
# Devuelve un array de [WebElements] que contiene las opciones de un elemento &lt;select&gt;
197193
all_available_options = select_object.options
198194
{{< / code-panel >}}
199195
{{< code-panel language="javascript" >}}
200-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
196+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
201197
{{< / code-panel >}}
202198
{{< code-panel language="kotlin" >}}
203-
// Return a List<WebElement> of options that the <select> element contains
199+
// Devuelve una lista de <WebElements> que contiene las opciones de un elemento <select>
204200
val allAvailableOptions = selectObject.options
205201
{{< / code-panel >}}
206202
{{< / code-tab >}}
207203

208-
If you want to deselect any elements, you now have four options:
204+
A la hora de deseleccionar elementos dispones de cuatro opciones:
209205

210206
{{< code-tab >}}
211207
{{< code-panel language="java" >}}
212-
// Deselect an <option> based upon the <select> element's internal index
208+
// Deseleccionar una <option> basándose en el indice interno de un elemento <select>
213209
selectObject.deselectByIndex(1);
214210

215-
// Deselect an <option> based upon its value attribute
211+
// Deseleccionar una <option> basándose en su atributo `value`
216212
selectObject.deselectByValue("value1");
217213

218-
// Deselect an <option> based upon its text
214+
// Deseleccionar una <option> basándose en el texto que muestra
219215
selectObject.deselectByVisibleText("Bread");
220216

221-
// Deselect all selected <option> elements
217+
// Deseleccionar todos los elementos <option> que estan seleccionados
222218
selectObject.deselectAll();
223219
{{< / code-panel >}}
224220
{{< code-panel language="python" >}}
225-
# Deselect an <option> based upon the <select> element's internal index
221+
# Deseleccionar una <option> basándose en el indice interno de un elemento <select>
226222
select_object.deselect_by_index(1)
227223

228-
# Deselect an <option> based upon its value attribute
224+
# Deseleccionar una <option> basándose en su atributo `value`
229225
select_object.deselect_by_value('value1')
230226

231-
# Deselect an <option> based upon its text
227+
# Deseleccionar una <option> basándose en el texto que muestra
232228
select_object.deselect_by_visible_text('Bread')
233229

234-
# Deselect all selected <option> elements
230+
# Deseleccionar todos los elementos <option> que estan seleccionados
235231
select_object.deselect_all()
236232
{{< / code-panel >}}
237233
{{< code-panel language="csharp" >}}
238-
// Deselect an <option> based upon the <select> element's internal index
234+
// Deseleccionar una <option> basándose en el indice interno de un elemento <select>
239235
selectObject.DeselectByIndex(1);
240236

241-
// Deselect an <option> based upon its value attribute
237+
// Deseleccionar una <option> basándose en su atributo `value`
242238
selectObject.DeselectByValue("value1");
243239

244-
// Deselect an <option> based upon its text
240+
// Deseleccionar una <option> basándose en el texto que muestra
245241
selectObject.DeselectByText("Bread");
246242

247-
// Deselect all selected <option> elements
243+
// Deseleccionar todos los elementos <option> que estan seleccionados
248244
selectObject.DeselectAll();
249245
{{< / code-panel >}}
250246
{{< code-panel language="ruby" >}}
251-
# Deselect an <option> based upon the <select> element's internal index
247+
# Deseleccionar una <option> basándose en el indice interno de un elemento <select>
252248
select_object.deselect_by(:index, 1)
253249

254-
# Deselect an <option> based upon its value attribute
250+
# Deseleccionar una <option> basándose en su atributo `value`
255251
select_object.deselect_by(:value, 'value1')
256252

257-
# Deselect an <option> based upon its text
253+
# Deseleccionar una <option> basándose en el texto que muestra
258254
select_object.deselect_by(:text, 'Bread')
259255

260-
# Deselect all selected <option> elements
256+
# Deseleccionar todos los elementos <option> que estan seleccionados
261257
select_object.deselect_all
262258
{{< / code-panel >}}
263259
{{< code-panel language="javascript" >}}
264-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
260+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
265261
{{< / code-panel >}}
266262
{{< code-panel language="kotlin" >}}
267-
// Deselect an <option> based upon the <select> element's internal index
263+
// Deseleccionar una <option> basándose en el indice interno de un elemento <select>
268264
selectObject.deselectByIndex(1)
269265

270-
// Deselect an <option> based upon its value attribute
266+
// Deseleccionar una <option> basándose en su atributo `value`
271267
selectObject.deselectByValue("value1")
272268

273-
// Deselect an <option> based upon its text
269+
// Deseleccionar una <option> basándose en el texto que muestra
274270
selectObject.deselectByVisibleText("Bread")
275271

276-
// Deselect all selected <option> elements
272+
// Deseleccionar todos los elementos <option> que estan seleccionados
277273
selectObject.deselectAll()
278274
{{< / code-panel >}}
279275
{{< / code-tab >}}
280276

281-
Finally, some `<select>` elements allow you to select more than one option.
282-
You can find out if your `<select>` element is one of these by using:
277+
Finalmente, existen algunos elementos `<select>` que te permiten seleccionar
278+
mas de una opción.
279+
Puedes comprobar si tu elemento `<select>` es uno de estos usando:
283280

284281
{{< code-tab >}}
285282
{{< code-panel language="java" >}}
@@ -295,7 +292,7 @@ bool doesThisAllowMultipleSelections = selectObject.IsMultiple;
295292
does_this_allow_multiple_selections = select_object.multiple?
296293
{{< / code-panel >}}
297294
{{< code-panel language="javascript" >}}
298-
// We don't have a JavaScript code sample yet - Help us out and raise a PR
295+
// No disponemos del ejemplo de código en Javascript aun - Ayudanos a ello abriendo un PR
299296
{{< / code-panel >}}
300297
{{< code-panel language="kotlin" >}}
301298
val doesThisAllowMultipleSelections = selectObject.isMultiple

0 commit comments

Comments
 (0)