Skip to content

Commit f65d268

Browse files
authored
Merge branch 'trunk' into SeleniumHQ#1697-Hugo-depericate-warning-custom-params-on-the-language-top-level
2 parents 7807853 + d9b0488 commit f65d268

17 files changed

+217
-108
lines changed

Diff for: examples/dotnet/SeleniumDocs/BaseTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BaseTest
1717
protected IWebDriver driver;
1818
protected Uri GridUrl;
1919
private Process _webserverProcess;
20-
private const string ServerJarName = "selenium-server-4.19.1.jar";
20+
private const string ServerJarName = "selenium-server-4.20.0.jar";
2121
private static readonly string BaseDirectory = AppContext.BaseDirectory;
2222
private const string RelativePathToGrid = "../../../../../";
2323
private readonly string _examplesDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, RelativePathToGrid));
+37-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
1+
using System;
12
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using OpenQA.Selenium;
4+
using OpenQA.Selenium.Chrome;
25

3-
namespace SeleniumDocs.Interactions
6+
namespace SeleniumDocumentation.SeleniumInteractions
47
{
58
[TestClass]
6-
public class NavigationTest : BaseTest
9+
public class NavigationTest
710
{
11+
[TestMethod]
12+
public void TestNavigationCommands()
13+
{
14+
IWebDriver driver = new ChromeDriver();
15+
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500);
16+
17+
//Convenient
18+
driver.Url = "https://selenium.dev";
19+
//Longer
20+
driver.Navigate().GoToUrl("https://selenium.dev");
21+
var title = driver.Title;
22+
Assert.AreEqual("Selenium", title);
23+
24+
//Back
25+
driver.Navigate().Back();
26+
title = driver.Title;
27+
Assert.AreEqual("Selenium", title);
28+
29+
//Forward
30+
driver.Navigate().Forward();
31+
title = driver.Title;
32+
Assert.AreEqual("Selenium", title);
33+
34+
//Refresh
35+
driver.Navigate().Refresh();
36+
title = driver.Title;
37+
Assert.AreEqual("Selenium", title);
38+
39+
//Quit the browser
40+
driver.Quit();
41+
}
842
}
9-
}
43+
}

Diff for: examples/python/tests/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def server_old(request):
130130
os.path.abspath(__file__)
131131
)
132132
),
133-
"selenium-server-4.19.1.jar",
133+
"selenium-server-4.20.0.jar",
134134
)
135135

136136
def wait_for_server(url, timeout):
@@ -188,7 +188,7 @@ def server():
188188
)
189189
)
190190
),
191-
"selenium-server-4.19.1.jar",
191+
"selenium-server-4.20.0.jar",
192192
)
193193

194194
args = [

Diff for: examples/ruby/spec/drivers/options_spec.rb

+77-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
RSpec.describe 'Chrome' do
66
describe 'Driver Options' do
77
let(:chrome_location) { driver_finder && ENV.fetch('CHROME_BIN', nil) }
8+
let(:url) { 'https://www.selenium.dev/selenium/web/' }
89

910
it 'page load strategy normal' do
1011
options = Selenium::WebDriver::Options.chrome
1112
options.page_load_strategy = :normal
1213

1314
driver = Selenium::WebDriver.for :chrome, options: options
14-
driver.get('https://www.google.com')
15+
driver.get(url)
1516
driver.quit
1617
end
1718

@@ -20,7 +21,7 @@
2021
options.page_load_strategy = :eager
2122

2223
driver = Selenium::WebDriver.for :chrome, options: options
23-
driver.get('https://www.google.com')
24+
driver.get(url)
2425
driver.quit
2526
end
2627

@@ -29,7 +30,7 @@
2930
options.page_load_strategy = :none
3031

3132
driver = Selenium::WebDriver.for :chrome, options: options
32-
driver.get('https://www.google.com')
33+
driver.get(url)
3334
driver.quit
3435
end
3536

@@ -42,7 +43,79 @@
4243
cloud_options[:name] = my_test_name
4344
options.add_option('cloud:options', cloud_options)
4445
driver = Selenium::WebDriver.for :remote, capabilities: options
45-
driver.get('https://www.google.com')
46+
driver.get(url)
47+
driver.quit
48+
end
49+
50+
it 'accepts untrusted certificates' do
51+
options = Selenium::WebDriver::Options.chrome
52+
options.accept_insecure_certs = true
53+
54+
driver = Selenium::WebDriver.for :chrome, options: options
55+
driver.get(url)
56+
driver.quit
57+
end
58+
59+
it 'sets unhandled prompt behavior' do
60+
options = Selenium::WebDriver::Options.chrome
61+
options.unhandled_prompt_behavior = :accept
62+
63+
driver = Selenium::WebDriver.for :chrome, options: options
64+
driver.get(url)
65+
driver.quit
66+
end
67+
68+
it 'sets window rect' do
69+
options = Selenium::WebDriver::Options.firefox
70+
options.set_window_rect = true
71+
72+
driver = Selenium::WebDriver.for :firefox, options: options
73+
driver.get(url)
74+
driver.quit
75+
end
76+
77+
it 'sets strict file interactability' do
78+
options = Selenium::WebDriver::Options.chrome
79+
options.strict_file_interactability = true
80+
81+
driver = Selenium::WebDriver.for :chrome, options: options
82+
driver.get(url)
83+
driver.quit
84+
end
85+
86+
it 'sets the proxy' do
87+
options = Selenium::WebDriver::Options.chrome
88+
options.proxy = Selenium::WebDriver::Proxy.new(http: 'myproxy.com:8080')
89+
90+
driver = Selenium::WebDriver.for :chrome, options: options
91+
driver.get(url)
92+
driver.quit
93+
end
94+
95+
it 'sets the implicit timeout' do
96+
options = Selenium::WebDriver::Options.chrome
97+
options.timeouts = {implicit: 1}
98+
99+
driver = Selenium::WebDriver.for :chrome, options: options
100+
driver.get(url)
101+
driver.quit
102+
end
103+
104+
it 'sets the page load timeout' do
105+
options = Selenium::WebDriver::Options.chrome
106+
options.timeouts = {page_load: 400_000}
107+
108+
driver = Selenium::WebDriver.for :chrome, options: options
109+
driver.get(url)
110+
driver.quit
111+
end
112+
113+
it 'sets the script timeout' do
114+
options = Selenium::WebDriver::Options.chrome
115+
options.timeouts = {script: 40_000}
116+
117+
driver = Selenium::WebDriver.for :chrome, options: options
118+
driver.get(url)
46119
driver.quit
47120
end
48121
end
Binary file not shown.

Diff for: website_and_docs/content/documentation/webdriver/drivers/options.en.md

+14-19
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Browser name is set by default when using an Options class instance.
4040
{{< badge-code >}}
4141
{{< /tab >}}
4242
{{< tab header="Ruby" >}}
43-
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L10" >}}
43+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L11" >}}
4444
{{< /tab >}}
4545
{{< tab header="JavaScript" >}}
4646
{{< badge-code >}}
@@ -67,7 +67,7 @@ it will be automatically downloaded by [Selenium Manager]({{< ref "../../seleniu
6767
{{< badge-code >}}
6868
{{< /tab >}}
6969
{{< tab header="Ruby" >}}
70-
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L35" >}}
70+
{{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L40" >}}
7171
{{< /tab >}}
7272
{{< tab header="JavaScript" >}}
7373
{{< badge-code >}}
@@ -139,7 +139,7 @@ namespace pageLoadStrategy {
139139
}
140140
{{< /tab >}}
141141
{{< tab header="Ruby" text=true >}}
142-
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L10-L11">}}
142+
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}}
143143
{{< /tab >}}
144144
{{< tab header="JavaScript" text=true >}}
145145
{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L28-L34">}}
@@ -196,7 +196,7 @@ namespace pageLoadStrategy {
196196
}
197197
{{< /tab >}}
198198
{{< tab header="Ruby" text=true >}}
199-
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L19-L20">}}
199+
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}}
200200
{{< /tab >}}
201201
{{< tab header="JavaScript" text=true >}}
202202
{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L8-L14">}}
@@ -252,7 +252,7 @@ namespace pageLoadStrategy {
252252
}
253253
{{< /tab >}}
254254
{{< tab header="Ruby" text=true >}}
255-
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L28-L29">}}
255+
{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}}
256256
{{< /tab >}}
257257
{{< tab header="JavaScript" text=true >}}
258258
{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L18-L24">}}
@@ -296,7 +296,7 @@ setting `platformName` sets the OS at the remote-end.
296296
{{< badge-code >}}
297297
{{< /tab >}}
298298
{{< tab header="Ruby" >}}
299-
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L37-L38" >}}
299+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L38-L39" >}}
300300
{{< /tab >}}
301301
{{< tab header="JavaScript" >}}
302302
{{< badge-code >}}
@@ -334,7 +334,7 @@ effect for the entire session.
334334
{{< badge-code >}}
335335
{{< /tab >}}
336336
{{< tab header="Ruby" >}}
337-
{{< badge-code >}}
337+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L51-L52" >}}
338338
{{< /tab >}}
339339
{{< tab header="JavaScript" >}}
340340
{{< badge-code >}}
@@ -369,7 +369,7 @@ is imposed when a new session is created by WebDriver.
369369
{{< badge-code >}}
370370
{{< /tab >}}
371371
{{< tab header="Ruby" >}}
372-
{{< badge-code >}}
372+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L114-L115" >}}
373373
{{< /tab >}}
374374
{{< tab header="JavaScript" >}}
375375
{{< badge-code >}}
@@ -398,7 +398,7 @@ _TimeoutException_.
398398
{{< badge-code >}}
399399
{{< /tab >}}
400400
{{< tab header="Ruby" >}}
401-
{{< badge-code >}}
401+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L105-L106" >}}
402402
{{< /tab >}}
403403
{{< tab header="JavaScript" >}}
404404
{{< badge-code >}}
@@ -425,7 +425,7 @@ is imposed when a new session is created by WebDriver.
425425
{{< badge-code >}}
426426
{{< /tab >}}
427427
{{< tab header="Ruby" >}}
428-
{{< badge-code >}}
428+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L96-L97" >}}
429429
{{< /tab >}}
430430
{{< tab header="JavaScript" >}}
431431
{{< badge-code >}}
@@ -463,7 +463,7 @@ user prompt encounters at the remote-end. This is defined by
463463
{{< badge-code >}}
464464
{{< /tab >}}
465465
{{< tab header="Ruby" >}}
466-
{{< badge-code >}}
466+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L60-L61" >}}
467467
{{< /tab >}}
468468
{{< tab header="JavaScript" >}}
469469
{{< badge-code >}}
@@ -488,7 +488,7 @@ Indicates whether the remote end supports all of the [resizing and repositioning
488488
{{< badge-code >}}
489489
{{< /tab >}}
490490
{{< tab header="Ruby" >}}
491-
{{< badge-code >}}
491+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L69-L70" >}}
492492
{{< /tab >}}
493493
{{< tab header="JavaScript" >}}
494494
{{< badge-code >}}
@@ -516,7 +516,7 @@ when using _Element Send Keys_ with hidden file upload controls.
516516
{{< badge-code >}}
517517
{{< /tab >}}
518518
{{< tab header="Ruby" >}}
519-
{{< badge-code >}}
519+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L78-L79" >}}
520520
{{< /tab >}}
521521
{{< tab header="JavaScript" >}}
522522
{{< badge-code >}}
@@ -603,12 +603,7 @@ driver.Navigate().GoToUrl("https://www.selenium.dev/");
603603
}
604604
{{< /tab >}}
605605
{{< tab header="Ruby" >}}
606-
607-
proxy = Selenium::WebDriver::Proxy.new(http: '<HOST:PORT>')
608-
cap = Selenium::WebDriver::Remote::Capabilities.chrome(proxy: proxy)
609-
610-
driver = Selenium::WebDriver.for(:chrome, capabilities: cap)
611-
driver.get('http://google.com')
606+
{{< gh-codeblock path="examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}}
612607
{{< /tab >}}
613608
{{< tab header="JavaScript" >}}
614609
let webdriver = require('selenium-webdriver');

0 commit comments

Comments
 (0)