Skip to content

Commit 7f2aa0a

Browse files
committed
Merge branch 'patch-1' of github.com:jflorez/seleniumhq.github.io into patch-1
2 parents bbee03e + d95089b commit 7f2aa0a

File tree

7 files changed

+94
-17
lines changed

7 files changed

+94
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package dev.selenium.interactions;
2+
3+
import dev.selenium.BaseChromeTest;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.Test;
6+
import org.openqa.selenium.Cookie;
7+
import java.util.Set;
8+
9+
public class InteractionsTest extends BaseChromeTest {
10+
@Test
11+
public void getTitle() {
12+
try {
13+
driver.get("https://www.selenium.dev/");
14+
// get title
15+
String title = driver.getTitle();
16+
Assertions.assertEquals(title, "Selenium");
17+
} finally {
18+
driver.quit();
19+
}
20+
}
21+
@Test
22+
public void getCurrentUrl() {
23+
try {
24+
driver.get("https://www.selenium.dev/");
25+
// get current url
26+
String url = driver.getCurrentUrl();
27+
Assertions.assertEquals(url, "https://www.selenium.dev/");
28+
} finally {
29+
driver.quit();
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from selenium import webdriver
2+
3+
driver = webdriver.Chrome()
4+
5+
driver.get("https://www.selenium.dev")
6+
7+
title = driver.title
8+
assert title == "Selenium"
9+
10+
url = driver.current_url
11+
assert url == "https://www.selenium.dev/"
12+
13+
driver.quit()

examples/ruby/Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ GEM
2828
diff-lcs (>= 1.2.0, < 2.0)
2929
rspec-support (~> 3.13.0)
3030
rspec-support (3.13.0)
31-
rubocop (1.63.0)
31+
rubocop (1.63.1)
3232
json (~> 2.3)
3333
language_server-protocol (>= 3.17.0)
3434
parallel (~> 1.10)

website_and_docs/content/documentation/webdriver/interactions/_index.en.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ You can read the current page title from the browser:
1717

1818
{{< tabpane langEqualsHeader=true >}}
1919
{{< badge-examples >}}
20-
{{< tab header="Java" >}}driver.getTitle();{{< /tab >}}
21-
{{< tab header="Python" >}}driver.title{{< /tab >}}
20+
{{< tab header="Java" text=true >}}
21+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}}
22+
{{< /tab >}}
23+
{{< tab header="Python" text=true >}}
24+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}}
25+
{{< /tab >}}
2226
{{< tab header="CSharp" >}}driver.Title;{{< /tab >}}
2327
{{< tab header="Ruby" >}}driver.title{{< /tab >}}
2428
{{< tab header="JavaScript" text=true >}}
@@ -34,8 +38,12 @@ You can read the current URL from the browser's address bar using:
3438

3539
{{< tabpane langEqualsHeader=true >}}
3640
{{< badge-examples >}}
37-
{{< tab header="Java" >}}driver.getCurrentUrl();{{< /tab >}}
38-
{{< tab header="Python" >}}driver.current_url{{< /tab >}}
41+
{{< tab header="Java" text=true >}}
42+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}}
43+
{{< /tab >}}
44+
{{< tab header="Python" text=true >}}
45+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}}
46+
{{< /tab >}}
3947
{{< tab header="CSharp" >}}driver.Url;{{< /tab >}}
4048
{{< tab header="Ruby" >}}driver.current_url{{< /tab >}}
4149
{{< tab header="JavaScript" text=true >}}

website_and_docs/content/documentation/webdriver/interactions/_index.ja.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ aliases: [
1616
ブラウザーから現在のページタイトルを読むことができます。
1717

1818
{{< tabpane langEqualsHeader=true >}}
19-
{{< tab header="Java" >}}driver.getTitle();{{< /tab >}}
20-
{{< tab header="Python" >}}driver.title{{< /tab >}}
19+
{{< tab header="Java" text=true >}}
20+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}}
21+
{{< /tab >}}
22+
{{< tab header="Python" text=true >}}
23+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}}
24+
{{< /tab >}}
2125
{{< tab header="CSharp" >}}driver.Title;{{< /tab >}}
2226
{{< tab header="Ruby" >}}driver.title{{< /tab >}}
2327
{{< tab header="JavaScript" text=true >}}
@@ -32,8 +36,12 @@ aliases: [
3236
ブラウザーのアドレスバーから現在のURLを読むには、次を使用します。
3337

3438
{{< tabpane langEqualsHeader=true >}}
35-
{{< tab header="Java" >}}driver.getCurrentUrl();{{< /tab >}}
36-
{{< tab header="Python" >}}driver.current_url{{< /tab >}}
39+
{{< tab header="Java" text=true >}}
40+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}}
41+
{{< /tab >}}
42+
{{< tab header="Python" text=true >}}
43+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}}
44+
{{< /tab >}}
3745
{{< tab header="CSharp" >}}driver.Url;{{< /tab >}}
3846
{{< tab header="Ruby" >}}driver.current_url{{< /tab >}}
3947
{{< tab header="JavaScript" text=true >}}

website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ aliases: [
1717
Você pode ler o título da página atual no navegador:
1818

1919
{{< tabpane langEqualsHeader=true >}}
20-
{{< tab header="Java" >}}driver.getTitle();{{< /tab >}}
21-
{{< tab header="Python" >}}driver.title{{< /tab >}}
20+
{{< tab header="Java" text=true >}}
21+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}}
22+
{{< /tab >}}
23+
{{< tab header="Python" text=true >}}
24+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}}
25+
{{< /tab >}}
2226
{{< tab header="CSharp" >}}driver.Title;{{< /tab >}}
2327
{{< tab header="Ruby" >}}driver.title{{< /tab >}}
2428
{{< tab header="JavaScript" text=true >}}
@@ -33,8 +37,12 @@ Você pode ler o título da página atual no navegador:
3337
Você pode ler a URL atual na barra de endereço do navegador usando:
3438

3539
{{< tabpane langEqualsHeader=true >}}
36-
{{< tab header="Java" >}}driver.getCurrentUrl();{{< /tab >}}
37-
{{< tab header="Python" >}}driver.current_url{{< /tab >}}
40+
{{< tab header="Java" text=true >}}
41+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}}
42+
{{< /tab >}}
43+
{{< tab header="Python" text=true >}}
44+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}}
45+
{{< /tab >}}
3846
{{< tab header="CSharp" >}}driver.Url;{{< /tab >}}
3947
{{< tab header="Ruby" >}}driver.current_url{{< /tab >}}
4048
{{< tab header="JavaScript" text=true >}}

website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ aliases: [
1616
从浏览器中读取当前页面的标题:
1717

1818
{{< tabpane langEqualsHeader=true >}}
19-
{{< tab header="Java" >}}driver.getTitle();{{< /tab >}}
20-
{{< tab header="Python" >}}driver.title{{< /tab >}}
19+
{{< tab header="Java" text=true >}}
20+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}}
21+
{{< /tab >}}
22+
{{< tab header="Python" text=true >}}
23+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L7" >}}
24+
{{< /tab >}}
2125
{{< tab header="CSharp" >}}driver.Title;{{< /tab >}}
2226
{{< tab header="Ruby" >}}driver.title{{< /tab >}}
2327
{{< tab header="JavaScript" text=true >}}
@@ -31,8 +35,12 @@ aliases: [
3135
您可以从浏览器的地址栏读取当前的 URL,使用:
3236

3337
{{< tabpane langEqualsHeader=true >}}
34-
{{< tab header="Java" >}}driver.getCurrentUrl();{{< /tab >}}
35-
{{< tab header="Python" >}}driver.current_url{{< /tab >}}
38+
{{< tab header="Java" text=true >}}
39+
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}}
40+
{{< /tab >}}
41+
{{< tab header="Python" text=true >}}
42+
{{< gh-codeblock path="examples/python/tests/interactions/test_interactions.py#L10" >}}
43+
{{< /tab >}}
3644
{{< tab header="CSharp" >}}driver.Url;{{< /tab >}}
3745
{{< tab header="Ruby" >}}driver.current_url{{< /tab >}}
3846
{{< tab header="JavaScript" text=true >}}

0 commit comments

Comments
 (0)