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

Commit 0af645f

Browse files
boris779diemol
authored andcommitted
TabDefinition
Added Kotlin tab in code-tab Signed-off-by: Diego Molina <[email protected]>
1 parent ef4d0dc commit 0af645f

File tree

98 files changed

+3200
-118
lines changed

Some content is hidden

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

98 files changed

+3200
-118
lines changed

docs_source_files/content/_index.en.md

+25
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
126126
}
127127
})();
128128
{{< / code-panel >}}
129+
{{< code-panel language="kotlin" >}}
130+
import org.openqa.selenium.By
131+
import org.openqa.selenium.Keys
132+
import org.openqa.selenium.WebDriver
133+
import org.openqa.selenium.WebElement
134+
import org.openqa.selenium.firefox.FirefoxDriver
135+
import org.openqa.selenium.support.ui.WebDriverWait
136+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
137+
138+
class HelloSelenium {
139+
140+
public main(args: Array<String>) {
141+
val driver = new FirefoxDriver()
142+
val wait = new WebDriverWait(driver, 10)
143+
try {
144+
driver.get("https://google.com/ncr")
145+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
146+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
147+
System.out.println(firstResult.getAttribute("textContent"))
148+
} finally {
149+
driver.quit()
150+
}
151+
}
152+
}
153+
{{< / code-panel >}}
129154
{{< / code-tab >}}
130155

131156

docs_source_files/content/_index.es.md

+25
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
115115
}
116116
})();
117117
{{< / code-panel >}}
118+
{{< code-panel language="kotlin" >}}
119+
import org.openqa.selenium.By
120+
import org.openqa.selenium.Keys
121+
import org.openqa.selenium.WebDriver
122+
import org.openqa.selenium.WebElement
123+
import org.openqa.selenium.firefox.FirefoxDriver
124+
import org.openqa.selenium.support.ui.WebDriverWait
125+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
126+
127+
class HelloSelenium {
128+
129+
public main(args: Array<String>) {
130+
val driver = new FirefoxDriver()
131+
val wait = new WebDriverWait(driver, 10)
132+
try {
133+
driver.get("https://google.com/ncr")
134+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
135+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
136+
System.out.println(firstResult.getAttribute("textContent"))
137+
} finally {
138+
driver.quit()
139+
}
140+
}
141+
}
142+
{{< / code-panel >}}
118143
{{< / code-tab >}}
119144

120145

docs_source_files/content/_index.fr.md

+25
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
124124
}
125125
})();
126126
{{< / code-panel >}}
127+
{{< code-panel language="kotlin" >}}
128+
import org.openqa.selenium.By
129+
import org.openqa.selenium.Keys
130+
import org.openqa.selenium.WebDriver
131+
import org.openqa.selenium.WebElement
132+
import org.openqa.selenium.firefox.FirefoxDriver
133+
import org.openqa.selenium.support.ui.WebDriverWait
134+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
135+
136+
class HelloSelenium {
137+
138+
public main(args: Array<String>) {
139+
val driver = new FirefoxDriver()
140+
val wait = new WebDriverWait(driver, 10)
141+
try {
142+
driver.get("https://google.com/ncr")
143+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
144+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
145+
System.out.println(firstResult.getAttribute("textContent"))
146+
} finally {
147+
driver.quit()
148+
}
149+
}
150+
}
151+
{{< / code-panel >}}
127152
{{< / code-tab >}}
128153

129154

docs_source_files/content/_index.ja.md

+29-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import org.openqa.selenium.WebDriver;
2323
import org.openqa.selenium.WebElement;
2424
import org.openqa.selenium.firefox.FirefoxDriver;
2525
import org.openqa.selenium.support.ui.WebDriverWait;
26-
2726
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
2827

2928
public class HelloSelenium {
@@ -34,8 +33,8 @@ public class HelloSelenium {
3433
try {
3534
driver.get("https://google.com/ncr");
3635
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER);
37-
WebElement firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>a")));
38-
System.out.println(firstResult.getText());
36+
WebElement firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")));
37+
System.out.println(firstResult.getAttribute("textContent"));
3938
} finally {
4039
driver.quit();
4140
}
@@ -54,8 +53,8 @@ with webdriver.Firefox() as driver:
5453
wait = WebDriverWait(driver, 10)
5554
driver.get("https://google.com/ncr")
5655
driver.find_element_by_name("q").send_keys("cheese" + Keys.RETURN)
57-
first_result = wait.until(presence_of_element_located((By.CSS_SELECTOR, "h3>a")))
58-
print(first_result.text)
56+
first_result = wait.until(presence_of_element_located((By.CSS_SELECTOR, "h3>div")))
57+
print(first_result.get_attribute("textContent"))
5958
{{< / code-panel >}}
6059
{{< code-panel language="csharp" >}}
6160
using System;
@@ -109,6 +108,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
109108
}
110109
})();
111110
{{< / code-panel >}}
111+
{{< code-panel language="kotlin" >}}
112+
import org.openqa.selenium.By
113+
import org.openqa.selenium.Keys
114+
import org.openqa.selenium.WebDriver
115+
import org.openqa.selenium.WebElement
116+
import org.openqa.selenium.firefox.FirefoxDriver
117+
import org.openqa.selenium.support.ui.WebDriverWait
118+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
119+
120+
class HelloSelenium {
121+
122+
public main(args: Array<String>) {
123+
val driver = new FirefoxDriver()
124+
val wait = new WebDriverWait(driver, 10)
125+
try {
126+
driver.get("https://google.com/ncr")
127+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
128+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
129+
System.out.println(firstResult.getAttribute("textContent"))
130+
} finally {
131+
driver.quit()
132+
}
133+
}
134+
}
135+
{{< / code-panel >}}
112136
{{< / code-tab >}}
113137

114138

docs_source_files/content/_index.nl.md

+25
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
132132
}
133133
})();
134134
{{< / code-panel >}}
135+
{{< code-panel language="kotlin" >}}
136+
import org.openqa.selenium.By
137+
import org.openqa.selenium.Keys
138+
import org.openqa.selenium.WebDriver
139+
import org.openqa.selenium.WebElement
140+
import org.openqa.selenium.firefox.FirefoxDriver
141+
import org.openqa.selenium.support.ui.WebDriverWait
142+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
143+
144+
class HelloSelenium {
145+
146+
public main(args: Array<String>) {
147+
val driver = new FirefoxDriver()
148+
val wait = new WebDriverWait(driver, 10)
149+
try {
150+
driver.get("https://google.com/ncr")
151+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
152+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
153+
System.out.println(firstResult.getAttribute("textContent"))
154+
} finally {
155+
driver.quit()
156+
}
157+
}
158+
}
159+
{{< / code-panel >}}
135160
{{< / code-tab >}}
136161

137162

docs_source_files/content/_index.zh-cn.md

+25
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ const {Builder, By, Key, until} = require('selenium-webdriver');
115115
}
116116
})();
117117
{{< / code-panel >}}
118+
{{< code-panel language="kotlin" >}}
119+
import org.openqa.selenium.By
120+
import org.openqa.selenium.Keys
121+
import org.openqa.selenium.WebDriver
122+
import org.openqa.selenium.WebElement
123+
import org.openqa.selenium.firefox.FirefoxDriver
124+
import org.openqa.selenium.support.ui.WebDriverWait
125+
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated
126+
127+
class HelloSelenium {
128+
129+
public main(args: Array<String>) {
130+
val driver = new FirefoxDriver()
131+
val wait = new WebDriverWait(driver, 10)
132+
try {
133+
driver.get("https://google.com/ncr")
134+
driver.findElement(By.name("q")).sendKeys("cheese" + Keys.ENTER)
135+
val firstResult = wait.until(presenceOfElementLocated(By.cssSelector("h3>div")))
136+
System.out.println(firstResult.getAttribute("textContent"))
137+
} finally {
138+
driver.quit()
139+
}
140+
}
141+
}
142+
{{< / code-panel >}}
118143
{{< / code-tab >}}
119144

120145
请参阅 _[快速浏览]({{< ref "/getting_started/quick.zh-cn.md" >}})_ 以获得运行此代码时幕后发生的事情的完整解释。

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.en.md

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ var driver = new FirefoxDriver(options);
3333
{{< code-panel language="javascript" >}}
3434
// We don't have a JavaScript code sample yet - Help us out and raise a PR
3535
{{< / code-panel >}}
36+
{{< code-panel language="kotlin" >}}
37+
val options = new FirefoxOptions()
38+
options.addPreference("network.proxy.type", 0)
39+
driver = RemoteWebDriver(options)
40+
{{< / code-panel >}}
3641
{{< / code-tab >}}
3742

3843

@@ -67,6 +72,11 @@ var driver = new RemoteWebDriver(options);
6772
{{< code-panel language="javascript" >}}
6873
// We don't have a JavaScript code sample yet - Help us out and raise a PR
6974
{{< / code-panel >}}
75+
{{< code-panel language="kotlin" >}}
76+
val options = FirefoxOptions()
77+
options.profile = FirefoxProfile()
78+
driver = RemoteWebDriver(options)
79+
{{< / code-panel >}}
7080
{{< / code-tab >}}
7181

7282
## Internet Explorer

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.es.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ title: "Capacidades especificas de los controladores"
33
weight: 2
44
---
55

6-
76
## Firefox
87

98
### Definir Capacidades (_Capabilities_) usando `FirefoxOptions`
@@ -33,6 +32,11 @@ var driver = new FirefoxDriver(options);
3332
{{< code-panel language="javascript" >}}
3433
// Todavía no tenemos una muestra de código JavaScript: ayúdenos y genere un PR (_pull request_)
3534
{{< / code-panel >}}
35+
{{< code-panel language="kotlin" >}}
36+
val options = new FirefoxOptions()
37+
options.addPreference("network.proxy.type", 0)
38+
driver = RemoteWebDriver(options)
39+
{{< / code-panel >}}
3640
{{< / code-tab >}}
3741

3842

@@ -67,9 +71,13 @@ var driver = new RemoteWebDriver(options);
6771
{{< code-panel language="javascript" >}}
6872
// Todavía no tenemos una muestra de código JavaScript: ayúdenos y genere un PR (_pull request_)
6973
{{< / code-panel >}}
74+
{{< code-panel language="kotlin" >}}
75+
val options = FirefoxOptions()
76+
options.profile = FirefoxProfile()
77+
driver = RemoteWebDriver(options)
78+
{{< / code-panel >}}
7079
{{< / code-tab >}}
7180

72-
7381
## Internet Explorer
7482

7583
### fileUploadDialogTimeout

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.fr.md

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ var driver = new FirefoxDriver(options);
3939
{{< code-panel language="javascript" >}}
4040
// We don't have a JavaScript code sample yet - Help us out and raise a PR
4141
{{< / code-panel >}}
42+
{{< code-panel language="kotlin" >}}
43+
val options = new FirefoxOptions()
44+
options.addPreference("network.proxy.type", 0)
45+
driver = RemoteWebDriver(options)
46+
{{< / code-panel >}}
4247
{{< / code-tab >}}
4348

4449

@@ -73,6 +78,11 @@ var driver = new RemoteWebDriver(options);
7378
{{< code-panel language="javascript" >}}
7479
// We don't have a JavaScript code sample yet - Help us out and raise a PR
7580
{{< / code-panel >}}
81+
{{< code-panel language="kotlin" >}}
82+
val options = FirefoxOptions()
83+
options.profile = FirefoxProfile()
84+
driver = RemoteWebDriver(options)
85+
{{< / code-panel >}}
7686
{{< / code-tab >}}
7787

7888
## Internet Explorer

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.ja.md

+10
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ var driver = new FirefoxDriver(options);
3838
{{< code-panel language="javascript" >}}
3939
// We don't have a JavaScript code sample yet - Help us out and raise a PR
4040
{{< / code-panel >}}
41+
{{< code-panel language="kotlin" >}}
42+
val options = new FirefoxOptions()
43+
options.addPreference("network.proxy.type", 0)
44+
driver = RemoteWebDriver(options)
45+
{{< / code-panel >}}
4146
{{< / code-tab >}}
4247

4348

@@ -72,6 +77,11 @@ var driver = new RemoteWebDriver(options);
7277
{{< code-panel language="javascript" >}}
7378
// We don't have a JavaScript code sample yet - Help us out and raise a PR
7479
{{< / code-panel >}}
80+
{{< code-panel language="kotlin" >}}
81+
val options = FirefoxOptions()
82+
options.profile = FirefoxProfile()
83+
driver = RemoteWebDriver(options)
84+
{{< / code-panel >}}
7585
{{< / code-tab >}}
7686

7787
## Internet Explorer

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.nl.md

+10
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ var driver = new FirefoxDriver(options);
3333
{{< code-panel language="javascript" >}}
3434
// We don't have a JavaScript code sample yet - Help us out and raise a PR
3535
{{< / code-panel >}}
36+
{{< code-panel language="kotlin" >}}
37+
val options = new FirefoxOptions()
38+
options.addPreference("network.proxy.type", 0)
39+
driver = RemoteWebDriver(options)
40+
{{< / code-panel >}}
3641
{{< / code-tab >}}
3742

3843

@@ -67,6 +72,11 @@ var driver = new RemoteWebDriver(options);
6772
{{< code-panel language="javascript" >}}
6873
// We don't have a JavaScript code sample yet - Help us out and raise a PR
6974
{{< / code-panel >}}
75+
{{< code-panel language="kotlin" >}}
76+
val options = FirefoxOptions()
77+
options.profile = FirefoxProfile()
78+
driver = RemoteWebDriver(options)
79+
{{< / code-panel >}}
7080
{{< / code-tab >}}
7181

7282
## Internet Explorer

docs_source_files/content/driver_idiosyncrasies/driver_specific_capabilities.zh-cn.md

+10
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ var driver = new FirefoxDriver(options);
3838
{{< code-panel language="javascript" >}}
3939
// We don't have a JavaScript code sample yet - Help us out and raise a PR
4040
{{< / code-panel >}}
41+
{{< code-panel language="kotlin" >}}
42+
val options = new FirefoxOptions()
43+
options.addPreference("network.proxy.type", 0)
44+
driver = RemoteWebDriver(options)
45+
{{< / code-panel >}}
4146
{{< / code-tab >}}
4247

4348

@@ -72,6 +77,11 @@ var driver = new RemoteWebDriver(options);
7277
{{< code-panel language="javascript" >}}
7378
// We don't have a JavaScript code sample yet - Help us out and raise a PR
7479
{{< / code-panel >}}
80+
{{< code-panel language="kotlin" >}}
81+
val options = FirefoxOptions()
82+
options.profile = FirefoxProfile()
83+
driver = RemoteWebDriver(options)
84+
{{< / code-panel >}}
7585
{{< / code-tab >}}
7686

7787
## Internet Explorer

0 commit comments

Comments
 (0)