Skip to content
This repository was archived by the owner on Jun 15, 2021. It is now read-only.

Commit a40e6a2

Browse files
authored
Setting file structure to allow translations, starting with Spanish (#281)
* Setting file structure to allow translations, starting with Spanish * Translating page titles to Spanish
1 parent 0f84af8 commit a40e6a2

File tree

138 files changed

+6158
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+6158
-52
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
toc.tmp
2-
docs_source_files/public
2+
docs_source_files/public
3+
.DS_Store

docs_source_files/config.toml

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
baseURL = "https://seleniumhq.github.io/docs/site"
22
languageCode = "en-US"
33
defaultContentLanguage = "en"
4+
# Force to have /en/my-page and /fr/my-page routes, even for default language.
5+
defaultContentLanguageInSubdir= true
6+
47
canonifyurls = "true"
58

6-
title = "Selenium Documentation"
9+
title = "Documentation for Selenium"
710
theme = "hugo-theme-learn"
811
copyright = "2013-{year}"
912

@@ -20,11 +23,22 @@ enableGitInfo = true
2023
themeVariant = "selenium"
2124
editURL = "https://github.com/SeleniumHQ/docs/edit/gh-pages/docs_source_files/content/"
2225
ghrepo = "https://github.com/SeleniumHQ/docs/"
23-
description = "Selenium Documentation"
26+
description = "Documentation for Selenium"
2427
showVisitedLinks = true
2528
disableBreadcrumb = false
2629
disableNextPrev = false
2730

2831
# For search functionality
2932
[outputs]
3033
home = [ "HTML", "RSS", "JSON"]
34+
35+
[Languages]
36+
[Languages.en]
37+
title = "Documentation for Selenium"
38+
weight = 1
39+
languageName = "English"
40+
41+
[Languages.es]
42+
title = "Documentación de Selenium"
43+
weight = 2
44+
languageName = "Español"

docs_source_files/content/_index.md docs_source_files/content/_index.en.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Selenium Documentation"
2+
title: "The Selenium Browser Automation Project"
33
---
44

55
# The Selenium Browser Automation Project
@@ -124,7 +124,7 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
124124
{{< / code-tab >}}
125125

126126

127-
See the _[Quick Tour]({{< ref "/getting_started/quick.md" >}})_ for a full explanation
127+
See the _[Quick Tour]({{< ref "/getting_started/quick.en.md" >}})_ for a full explanation
128128
of what goes on behind the scenes when you run this code.
129129
You should continue on to the [narrative documentation]({{< ref "/introduction/_index.md" >}})
130130
to understand how you can [install]({{< ref "/selenium_installation/_index.md" >}}) and
@@ -139,10 +139,10 @@ If you are new to Selenium,
139139
we have a few resources that can help you
140140
get up to speed right away.
141141

142-
* [Quick tour]({{< ref "/getting_started/quick.md" >}})
143-
* [WebDriver]({{< ref "/getting_started/quick.md#webdriver" >}})
144-
* [Remote Control]({{< ref "/getting_started/quick.md#remote-control" >}})
145-
* [IDE]({{< ref "/getting_started/quick.md#ide" >}})
146-
* [Grid]({{< ref "/getting_started/quick.md#grid" >}})
147-
* [HTML Runner]({{< ref "/getting_started/quick.md#html-runner" >}})
142+
* [Quick tour]({{< ref "/getting_started/quick.en.md" >}})
143+
* [WebDriver]({{< ref "/getting_started/quick.en.md#webdriver" >}})
144+
* [Remote Control]({{< ref "/getting_started/quick.en.md#remote-control" >}})
145+
* [IDE]({{< ref "/getting_started/quick.en.md#ide" >}})
146+
* [Grid]({{< ref "/getting_started/quick.en.md#grid" >}})
147+
* [HTML Runner]({{< ref "/getting_started/quick.en.md#html-runner" >}})
148148

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
title: "El Proyecto para Automatización de Navegadores Selenium"
3+
---
4+
5+
{{% notice info %}}
6+
<i class="fas fa-language"></i> Page being translated from
7+
English to Spanish. Do you speak Spanish? Help us to translate
8+
it by sending us pull requests!
9+
{{% /notice %}}
10+
11+
# El Proyecto para Automatización de Navegadores Selenium
12+
13+
Selenium is an umbrella project for a range of tools and libraries
14+
that enable and support the automation of web browsers.
15+
16+
It provides extensions to emulate user interaction with browsers,
17+
a distribution server for scaling browser allocation,
18+
and the infrastructure for implementations of the
19+
[W3C WebDriver specification](//www.w3.org/TR/webdriver/)
20+
that lets you write interchangeable code for all major web browsers.
21+
22+
This project is made possible by volunteer contributors
23+
who have put in thousands of hours of their own time,
24+
and made the source code [freely available](attr.md#license)
25+
for anyone to use, enjoy, and improve.
26+
27+
Selenium brings together browser vendors, engineers, and enthusiasts
28+
to further an open discussion around automation of the web platform.
29+
The project organises [an annual conference](//seleniumconf.com/)
30+
to teach and nurture the community.
31+
32+
At the core of Selenium is _[WebDriver]({{< ref "/webdriver/_index.md" >}})_,
33+
an interface to write instruction sets that can be run interchangeably in many
34+
browsers. Here is one of the simplest instructions you can make:
35+
36+
{{< code-tab >}}
37+
{{< code-panel language="java" >}}
38+
import org.openqa.selenium.By;
39+
import org.openqa.selenium.Keys;
40+
import org.openqa.selenium.WebDriver;
41+
import org.openqa.selenium.WebElement;
42+
import org.openqa.selenium.firefox.FirefoxDriver;
43+
import org.openqa.selenium.support.ui.WebDriverWait;
44+
45+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
46+
47+
public class HelloSelenium {
48+
49+
public static void main(String[] args) {
50+
WebDriver driver = new FirefoxDriver();
51+
WebDriverWait wait = new WebDriverWait(driver, 10);
52+
try {
53+
driver.get("https://google.com/ncr");
54+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER);
55+
WebElement firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>a")));
56+
System.out.println(firstResult.getText());
57+
} finally {
58+
driver.quit();
59+
}
60+
}
61+
}
62+
{{< / code-panel >}}
63+
{{< code-panel language="python" >}}
64+
from selenium import webdriver
65+
from selenium.webdriver.common.by import By
66+
from selenium.webdriver.common.keys import Keys
67+
from selenium.webdriver.support.ui import WebDriverWait
68+
from selenium.webdriver.support.expected_conditions import presence_of_element_located
69+
70+
#This example requires Selenium WebDriver 3.13 or newer
71+
with webdriver.Firefox() as driver:
72+
wait = WebDriverWait(driver, 10)
73+
driver.get("https://google.com/ncr")
74+
driver.find_element_by_name("q").send_keys("cheese" + Keys.RETURN)
75+
first_result = wait.until(presence_of_element_located((By.CSS_SELECTOR, "h3>a")))
76+
print(first_result.text)
77+
{{< / code-panel >}}
78+
{{< code-panel language="csharp" >}}
79+
using System;
80+
using OpenQA.Selenium;
81+
using OpenQA.Selenium.Firefox;
82+
using OpenQA.Selenium.Support.UI;
83+
using SeleniumExtras.WaitHelpers;
84+
85+
class HelloSelenium
86+
{
87+
static void Main()
88+
{
89+
using (IWebDriver driver = new FirefoxDriver())
90+
{
91+
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
92+
driver.Navigate().GoToUrl("https://www.google.com/ncr");
93+
driver.FindElement(By.Name("q")).SendKeys("cheese" + Keys.Enter);
94+
IWebElement firstResult = wait.Until(ExpectedConditions.ElementExists(By.CssSelector("h3>a")));
95+
Console.WriteLine(firstResult.Text);
96+
}
97+
}
98+
}
99+
{{< / code-panel >}}
100+
{{< code-panel language="ruby" >}}
101+
require 'selenium-webdriver'
102+
103+
driver = Selenium::WebDriver.for :firefox
104+
wait = Selenium::WebDriver::Wait.new(timeout: 10)
105+
106+
begin
107+
driver.get 'https://google.com/ncr'
108+
driver.find_element(name: 'q').send_keys 'cheese', :return
109+
first_result = wait.until { driver.find_element(css: 'h3>a') }
110+
puts first_result.text
111+
ensure
112+
driver.quit
113+
end
114+
{{< / code-panel >}}
115+
{{< code-panel language="javascript" >}}
116+
const {Builder, By, Key, until} = require('selenium-webdriver');
117+
118+
(async function example() {
119+
let driver = await new Builder().forBrowser('firefox').build();
120+
try {
121+
await driver.get('https://www.google.com/ncr');
122+
await driver.findElement(By.name('q')).sendKeys('cheese', Key.RETURN);
123+
let firstResult = await driver.wait(until.elementLocated(By.css('h3>a')),10000);
124+
console.log(await firstResult.getText());
125+
} finally {
126+
await driver.quit();
127+
}
128+
})();
129+
{{< / code-panel >}}
130+
{{< / code-tab >}}
131+
132+
133+
See the _[Quick Tour]({{< ref "/getting_started/quick.es.md" >}})_ for a full explanation
134+
of what goes on behind the scenes when you run this code.
135+
You should continue on to the [narrative documentation]({{< ref "/introduction/_index.md" >}})
136+
to understand how you can [install]({{< ref "/selenium_installation/_index.md" >}}) and
137+
successfully use Selenium as a test automation tool,
138+
and scaling simple tests like this to run
139+
in large, distributed environments on multiple browsers,
140+
on several different operating systems.
141+
142+
## Getting started
143+
144+
If you are new to Selenium,
145+
we have a few resources that can help you
146+
get up to speed right away.
147+
148+
* [Quick tour]({{< ref "/getting_started/quick.es.md" >}})
149+
* [WebDriver]({{< ref "/getting_started/quick.es.md#webdriver" >}})
150+
* [Remote Control]({{< ref "/getting_started/quick.es.md#remote-control" >}})
151+
* [IDE]({{< ref "/getting_started/quick.es.md#ide" >}})
152+
* [Grid]({{< ref "/getting_started/quick.es.md#grid" >}})
153+
* [HTML Runner]({{< ref "/getting_started/quick.es.md#html-runner" >}})
154+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: "Carácter de los controladores"
3+
chapter: true
4+
weight: 10
5+
---
6+
7+
{{% notice info %}}
8+
<i class="fas fa-language"></i> Page being translated from
9+
English to Spanish. Do you speak Spanish? Help us to translate
10+
it by sending us pull requests!
11+
{{% /notice %}}
12+
13+
14+
# Carácter de los controladores
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: "Capacidades especificas de los controladores"
3+
weight: 2
4+
---
5+
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 %}}
11+
12+
## Firefox
13+
14+
### Define Capabilities using `FirefoxOptions`
15+
16+
`FirefoxOptions` is the new way to define capabilities for the Firefox
17+
browser and should generally be used in preference to DesiredCapabilities.
18+
19+
{{< code-tab >}}
20+
{{< code-panel language="java" >}}
21+
FirefoxOptions options = new FirefoxOptions();
22+
options.addPreference("network.proxy.type", 0);
23+
driver = new RemoteWebDriver(options);
24+
{{< / code-panel >}}
25+
{{< code-panel language="python" >}}
26+
# We don't have a Python code sample yet - Help us out and raise a PR
27+
{{< / code-panel >}}
28+
{{< code-panel language="csharp" >}}
29+
// We don't have a C# code sample yet - Help us out and raise a PR
30+
{{< / code-panel >}}
31+
{{< code-panel language="ruby" >}}
32+
# We don't have a Ruby code sample yet - Help us out and raise a PR
33+
{{< / code-panel >}}
34+
{{< code-panel language="javascript" >}}
35+
// We don't have a JavaScript code sample yet - Help us out and raise a PR
36+
{{< / code-panel >}}
37+
{{< / code-tab >}}
38+
39+
40+
### Setting a custom profile
41+
42+
It is possible to create a custom profile for Firefox as demonstrated below.
43+
44+
{{< code-tab >}}
45+
{{< code-panel language="java" >}}
46+
FirefoxProfile profile = new FirefoxProfile();
47+
FirefoxOptions options = new FirefoxOptions();
48+
options.setProfile(profile);
49+
driver = new RemoteWebDriver(options);
50+
{{< / code-panel >}}
51+
{{< code-panel language="python" >}}
52+
# We don't have a Python code sample yet - Help us out and raise a PR
53+
{{< / code-panel >}}
54+
{{< code-panel language="csharp" >}}
55+
// We don't have a C# code sample yet - Help us out and raise a PR
56+
{{< / code-panel >}}
57+
{{< code-panel language="ruby" >}}
58+
# We don't have a Ruby code sample yet - Help us out and raise a PR
59+
{{< / code-panel >}}
60+
{{< code-panel language="javascript" >}}
61+
// We don't have a JavaScript code sample yet - Help us out and raise a PR
62+
{{< / code-panel >}}
63+
{{< / code-tab >}}
64+
65+
## Internet Explorer
66+
67+
### fileUploadDialogTimeout
68+
69+
In some environments, Internet Explorer may timeout when opening the
70+
File Upload dialog. IEDriver has a default timeout of 1000ms, but you
71+
can increase the timeout using the fileUploadDialogTimeout capability.
72+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Capacidades compartidas"
3+
weight: 1
4+
---
5+
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 %}}
11+
12+
### pageLoadStrategy
13+
When navigating to a new page via URL, by default Selenium will wait
14+
until the page has fully loaded before responding. This works well for
15+
beginners, but can cause long wait times on pages that load a large
16+
number of third party resources. Using a non default strategy can make
17+
test execution faster in cases like this, but can also introduce flakiness
18+
where elements on the page change position as elements load in and change
19+
size.
20+
21+
The page load strategy queries the
22+
[document.readyState](//developer.mozilla.org/en-US/docs/Web/API/Document/readyState)
23+
as described in the table below:
24+
25+
| Strategy | Ready State | Notes |
26+
| -------- | ----------- | ----- |
27+
| normal | complete | Used by default, waits for all resources to download |
28+
| eager | interactive | DOM access is ready, but other resources like images may still be loading |
29+
| none | Any | Does not block WebDriver at all |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: "Texto preliminar"
3+
chapter: true
4+
weight: 12
5+
---
6+
7+
{{% notice info %}}
8+
<i class="fas fa-language"></i> Page being translated from
9+
English to Spanish. Do you speak Spanish? Help us to translate
10+
it by sending us pull requests!
11+
{{% /notice %}}
12+
13+
# Texto preliminar

docs_source_files/content/front_matter/copyright_and_attributions.md docs_source_files/content/front_matter/copyright_and_attributions.en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Copyright and attributions"
33
weight: 1
44
---
55

6-
## **The Selenium Documentation**
6+
## **The Documentation of Selenium**
77

88
Copyright {{< copyright >}}, Software Freedom Conservancy.
99

0 commit comments

Comments
 (0)