Skip to content

Add spanish translation to sites #357

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 22, 2020
Merged
Show file tree
Hide file tree
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,19 +1,14 @@
---
title: "Locating elements"
title: "Localizando elementos"
weight: 3
---

{{% notice info %}}
<i class="fas fa-language"></i> Page being translated from
English to Spanish. Do you speak Spanish? Help us to translate
it by sending us pull requests!
{{% /notice %}}
### Localizando un elemento

### Locating one element

One of the most fundamental techniques to learn when using WebDriver is
how to find elements on the page. WebDriver offers a number of built-in selector
types, amongst them finding an element by its ID attribute:
Una de las técnicas más fundamentales para aprender al usar WebDriver
es cómo encontrar elementos en la página. WebDriver ofrece varios
tipos de selectores integrados, entre ellos encontrar un elemento por
su atributo ID:

{{< code-tab >}}
{{< code-panel language="java" >}}
Expand All @@ -36,17 +31,19 @@ val cheese: WebElement = driver.findElement(By.id("cheese"))
{{< / code-panel >}}
{{< / code-tab >}}

As seen in the example, locating elements in WebDriver is done on the
`WebDriver` instance object. The `findElement(By)` method returns
another fundamental object type, the `WebElement`.
Como se ve en el ejemplo, localizar elementos en WebDriver
se realiza en la instancia del objeto `WebDriver`. El método
`findElement(By)` devuelve otro tipo de objeto fundamental,
el `WebElement`.

* `WebDriver` represents the browser
* `WebElement` represents a particular DOM node
(a control, e.g. a link or input field, etc.)
* `WebDriver` representa el navegador
* `WebElement` representa un
nodo particular del DOM (un control, por ejemplo un enlace o campo de
entrada, etc.)

Once you have a reference to a web element that's been “found”,
you can narrow the scope of your search
by using the same call on that object instance:
Una vez que tengas una referencia a un elemento web que se ha
"encontrado", puedes reducir el alcance de tu búsqueda utilizando la
misma llamada en la instancia de ese objeto:

{{< code-tab >}}
{{< code-panel language="java" >}}
Expand Down Expand Up @@ -75,28 +72,25 @@ val cheddar = cheese.findElement(By.id("cheddar"))
{{< / code-panel >}}
{{< / code-tab >}}

You can do this because both the _WebDriver_ and _WebElement_ types
implement the [_SearchContext_](//seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/SearchContext.html)
interface. In WebDriver, this is known as a _role-based interface_.
Role-based interfaces allow you to determine whether a particular
driver implementation supports a given feature. These interfaces are
clearly defined and try to adhere to having only a single role of
responsibility. You can read more about WebDriver's design and what
roles are supported in which drivers in the [Some Other Section Which
Must Be Named](#).
Puedes hacer esto porque los tipos _WebDriver_ y _WebElement_
implementan la interfaz [_SearchContext_](//seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/SearchContext.html).
En WebDriver, esto se conoce como _interfaz basada en roles_.
Las interfaces basadas en roles te permiten determinar si
la implementación del controlador admite una característica dada.
Estas interfaces están claramente definidas y tratan de cumplir con
tener un solo rol de responsabilidad. Puede leer más sobre el diseño
de WebDriver y qué roles son compatibles con qué controladores en [Otra sección](#).
<!-- TODO: A new section needs to be created for the above.-->

Consequently, the _By_ interface used above also supports a
number of additional locator strategies. A nested lookup might not be
the most effective cheese location strategy since it requires two
separate commands to be issued to the browser; first searching the DOM
for an element with ID “cheese”, then a search for “cheddar” in a
narrowed context.
En consecuencia, la interfaz _By_ utilizada anteriormente también permite una serie de
estrategias adicionales de localización. Una búsqueda anidada podría no ser la
estrategia mas efectiva para localizar _cheese_ ya que requiere dos
comandos que se emitirán al navegador; primero buscando en el DOM un
elemento con ID "cheese", luego una búsqueda de "cheddar" en un contexto reducido.

To improve the performance slightly, we should try to use a more
specific locator: WebDriver supports looking up elements
by CSS locators, allowing us to combine the two previous locators into
one search:
Para mejorar ligeramente el rendimiento, deberíamos intentar utilizar un
localizador más específico: WebDriver permite buscar elementos por localizadores CSS,
lo que nos permite combinar los dos localizadores anteriores en una sola búsqueda:

{{< code-tab >}}
{{< code-panel language="java" >}}
Expand All @@ -119,10 +113,10 @@ driver.findElement(By.cssSelector("#cheese #cheddar"))
{{< / code-panel >}}
{{< / code-tab >}}

### Locating multiple elements
### Localizando múltiples elementos

It is possible that the document we are working with may turn out to have an
ordered list of the cheese we like the best:
Es posible que el documento con el que estamos trabajando contenga
una lista ordenada del queso que más nos gusta:

```html
<ol id=cheese>
Expand All @@ -132,15 +126,13 @@ ordered list of the cheese we like the best:
<li id=camembert>…
</ul>
```

Since more cheese is undisputably better, and it would be cumbersome
to have to retrieve each of the items individually, a superior
technique for retrieving cheese is to make use of the pluralized
version `findElements(By)`. This method returns a collection of web
elements. If only one element is found, it will still return a
collection (of one element). If no element matches the locator, an
empty list will be returned.

Dado que más queso es indiscutiblemente mejor, y sería engorroso
tener que recuperar cada uno de los elementos individualmente,
una técnica superior para recuperar _cheese_ es hacer uso de la
versión pluralizada `findElements(By)`. Este método devuelve una
colección de elementos web. Si solo se encuentra un elemento, aún devolverá una
colección (de un elemento). Si ningún elemento coincide con el localizador,
se devolverá la lista vacía.
{{< code-tab >}}
{{< code-panel language="java" >}}
List<WebElement> muchoCheese = driver.findElements(By.cssSelector("#cheese li"));
Expand All @@ -162,44 +154,47 @@ val muchoCheese: List<WebElement> = driver.findElements(By.cssSelector("#cheese
{{< / code-panel >}}
{{< / code-tab >}}

### Element selection strategies
### Estrategias de localización de elementos

There are eight different built-in element location strategies in WebDriver:
Hay ocho estrategias diferentes de ubicación de elementos integradas en WebDriver:

| Locator | Description |
| Localizador | Descripción |
| -------- | ---------- |
| class name | Locates elements whose class name contains the search value (compound class names are not permitted) |
| css selector | Locates elements matching a CSS selector |
| id | Locates elements whose ID attribute matches the search value |
| name | Locates elements whose NAME attribute matches the search value |
| link text | Locates anchor elements whose visible text matches the search value |
| partial link text | Locates anchor elements whose visible text contains the search value. If multiple elements are matching, only the first one will be selected. |
| tag name | Locates elements whose tag name matches the search value |
| xpath | Locates elements matching an XPath expression |

### Tips on using selectors

In general, if HTML IDs are available, unique, and consistently
predictable, they are the preferred method for locating an element on
a page. They tend to work very quickly, and forego much processing
that comes with complicated DOM traversals.

If unique IDs are unavailable, a well-written CSS selector is the
preferred method of locating an element. XPath works as well as CSS
selectors, but the syntax is complicated and frequently difficult to
debug. Though XPath selectors are very flexible, they are typically
not performance tested by browser vendors and tend to be quite slow.

Selection strategies based on link text and partial link text have
drawbacks in that they only work on link elements. Additionally, they
call down to XPath selectors internally in WebDriver.

Tag name can be a dangerous way to locate elements. There are
frequently multiple elements of the same tag present on the page.
This is mostly useful when calling the _findElements(By)_ method which
returns a collection of elements.

The recommendation is to keep your locators as compact and
readable as possible. Asking WebDriver to traverse the DOM structure
is an expensive operation, and the more you can narrow the scope of
your search, the better.
| class name | Localiza elementos en el que el nombre de su clase contiene el valor de la búsqueda (no se permiten nombres de clase compuestos) |
| css selector | Localiza elementos que coinciden con un selector CSS |
| id | Localiza elementos cuyo atributo ID coincide con el valor de la búsqueda |
| name | Localiza elementos cuyo atributo NAME coincide con el valor de la búsqueda |
| link text | Localiza elementos de anclaje cuyo texto visible coincide con el valor de búsqueda |
| partial link text | Localiza elementos de anclaje cuyo texto visible coincide con el valor de búsqueda. Si varios elementos coinciden, solo se seleccionará el primero. |
| tag name | Localiza elementos cuyo nombre de etiqueta (tagName) coincide con el valor de búsqueda |
| xpath | Localiza elementos que coinciden con una expresión XPath |

### Consejos sobre el uso de selectores

En general, si los ID del HTML están disponibles, son únicos y
consistentemente predecibles, son el método preferido para ubicar un
elemento en una página. Tienden a trabajar muy rápido y renuncian al
mucho procesamiento que viene con recorridos DOM complicados.

Si las ID únicas no están disponibles, un selector CSS bien escrito
es el método preferido para localizar un elemento. XPath funciona tan
bien como los selectores CSS, pero la sintaxis es complicada y con
frecuencia difícil de depurar. Aunque los selectores XPath son muy
flexibles, generalmente su desempeño no es probado por lo proveedores
de navegadores y tienden a ser bastante lentos.

Las estrategias de selección basadas en enlaces de texto y enlaces de
texto parciales tienen el inconveniente en que solo funcionan en
elementos de enlace. Además, internamente en WebDriver llaman a los
selectores XPath.

El nombre de la etiqueta puede ser una forma peligrosa de localizar
elementos. Existen frecuentemente múltiples elementos con la misma
etiqueta presentes en la página. Esto es mayormente útil cuando se
llama al método _findElements(By)_ que devuelve una colección de
elementos.

La recomendación es mantener tus localizadores tan compactos y
legibles como sea posible. Pedirle a WebDriver que atraviese la
estructura del DOM es una operación costosa, y cuanto más se pueda
reducir el alcance de tu búsqueda, mejor.
29 changes: 12 additions & 17 deletions docs_source_files/content/webdriver/_index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,22 @@ chapter: true
weight: 5
---

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

# WebDriver

WebDriver drives a browser natively, as a user would, either locally
or on a remote machine using the Selenium server,
marks a leap forward in terms of browser automation.
WebDriver controla un navegador de forma nativa, como lo haría un
usuario, ya sea localmente o en una máquina remota utilizando el
servidor Selenium, marca un salto adelante en términos de
automatización de navegadores.

Selenium WebDriver refers to both the language bindings
and the implementations of the individual browser controlling code.
This is commonly referred to as just _WebDriver_.
Selenium WebDriver se refiere tanto a los enlaces de lenguajes como también
a las implementaciones individuales del código controlador del
navegador. Esto se conoce comúnmente solo como _WebDriver_.

Selenium WebDriver is a [W3C Recommendation](https://www.w3.org/TR/webdriver1/)
Selenium WebDriver es una [Recomendación W3C](https://www.w3.org/TR/webdriver1/)

* WebDriver is designed as a simple
and more concise programming interface.
* WebDriver está diseñado como una interfaz de programación
simple y más concisa.

* WebDriver is a compact object-oriented API.
* WebDriver es una API compacta orientada a objetos.

* It drives the browser effectively.
* Controla el navegador de manera efectiva.
12 changes: 6 additions & 6 deletions docs_source_files/content/webdriver/driver_requirements.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ Puedes recuperar el control de la consola de comandos pulsando <kbd>Ctrl + C</kb

Navegador | SO Soportados | Mantenido por | Descargas | Issues |
| ------- | ------------ | ------------- | -------- | ------------- |
| Chromium/Chrome | Windows/macOS/Linux | Google | [Descargas](//chromedriver.storage.googleapis.com/index.html) | [Issues](//bugs.chromium.org/p/chromedriver/issues/list) |
| Firefox | Windows/macOS/Linux | Mozilla | [Descargas](//github.com/mozilla/geckodriver/releases) | [Issues](//github.com/mozilla/geckodriver/issues) |
| Edge | Windows 10 | Microsoft | [Descargas](//developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) | [Issues](//developer.microsoft.com/en-us/microsoft-edge/platform/issues/?page=1&amp;q=webdriver) |
| Internet Explorer | Windows | Proyecto de Selenium | [Descargas](//selenium-release.storage.googleapis.com/index.html) | [Issues](//github.com/SeleniumHQ/selenium/labels/D-IE) |
| Safari | macOS El Capitan and newer | Apple | Integrado | [Issues](//bugreport.apple.com/logon) |
| Opera | Windows/macOS/Linux | Opera | [Descargas](//github.com/operasoftware/operachromiumdriver/releases) | [Issues](//github.com/operasoftware/operachromiumdriver/issues) |
| Chromium/Chrome | Windows/macOS/Linux | Google | [Descargas](//chromedriver.storage.googleapis.com/index.html) | [Incidentes](//bugs.chromium.org/p/chromedriver/issues/list) |
| Firefox | Windows/macOS/Linux | Mozilla | [Descargas](//github.com/mozilla/geckodriver/releases) | [Incidentes](//github.com/mozilla/geckodriver/issues) |
| Edge | Windows 10 | Microsoft | [Descargas](//developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) | [Incidentes](//developer.microsoft.com/en-us/microsoft-edge/platform/issues/?page=1&amp;q=webdriver) |
| Internet Explorer | Windows | Proyecto de Selenium | [Descargas](//selenium-release.storage.googleapis.com/index.html) | [Incidentes](//github.com/SeleniumHQ/selenium/labels/D-IE) |
| Safari | macOS El Capitan and newer | Apple | Integrado | [Incidentes](//bugreport.apple.com/logon) |
| Opera | Windows/macOS/Linux | Opera | [Descargas](//github.com/operasoftware/operachromiumdriver/releases) | [Incidentes](//github.com/operasoftware/operachromiumdriver/issues) |


### Chromium/Chrome
Expand Down
36 changes: 15 additions & 21 deletions docs_source_files/content/webdriver/http_proxies.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,25 @@ title: "Proxies Http"
weight: 7
---

{{% notice info %}}
<i class="fas fa-language"></i> Page being translated from
English to Spanish. Do you speak Spanish? Help us to translate
it by sending us pull requests!
{{% /notice %}}
Un servidor proxy actúa como intermediario para
solicitudes entre un cliente y un servidor. En forma simple,
el tráfico fluye a través del servidor proxy
en camino a la dirección solicitada y de regreso.

A proxy server acts as an intermediary for
requests between a client and a server. In simple,
the traffic flows through the proxy server
on its way to the address you requested and back.
Un servidor proxy para scripts de automatización con
Selenium podría ser útil para:

A proxy server for automation scripts with
Selenium could be helpful for:
* Captura el tráfico de la red
* Simular llamadas de backend realizadas por el sitio web
* Accede al sitio web requerido bajo topologías de red complejas
o restricciones/políticas corporativas estrictas.

* Capture network traffic
* Mock backend calls made by the website
* Access the requited website under complex network
topologies or strict corporate restrictions/policies.
Si te encuentras en un entorno corporativo, y un
navegador no puede conectarse a una URL, esto es
muy probablemente porque el ambiente necesita un
proxy para acceder.

If you are in a corporate environment, and a
browser fails to connect to a URL, this is
most likely because the environment needs a
proxy to be accessed.

Selenium WebDriver provides a way to proxy settings
Selenium WebDriver proporciona una via para configurar el proxy:

{{< code-tab >}}
{{< code-panel language="java" >}}
Expand Down
Loading