Skip to content

Commit e33fbd4

Browse files
committed
update example code for 4.7 and remove IE Driver manager requirements
1 parent ed78f05 commit e33fbd4

File tree

22 files changed

+81
-153
lines changed

22 files changed

+81
-153
lines changed

examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,11 @@ namespace SeleniumDocs.Browsers
1010
[EnabledOnOs("WINDOWS")]
1111
public class InternetExplorerTest
1212
{
13-
[TestInitialize]
14-
public void ReferenceHardCodedDriver()
15-
{
16-
var hardCodedPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "../../../");
17-
var path = Path.GetFullPath(hardCodedPath);
18-
Environment.SetEnvironmentVariable("IE_DRIVER_PATH", path);
19-
}
20-
2113
[TestMethod]
2214
public void BasicOptions()
2315
{
24-
var driverPath = Environment.GetEnvironmentVariable("IE_DRIVER_PATH");
25-
var service = InternetExplorerDriverService.CreateDefaultService(driverPath);
26-
var options = new InternetExplorerOptions
27-
{
28-
IgnoreZoomLevel = true,
29-
};
30-
var driver = new InternetExplorerDriver(service, options);
16+
var options = new InternetExplorerOptions();
17+
var driver = new InternetExplorerDriver(options);
3118

3219
driver.Quit();
3320
}
-2.93 MB
Binary file not shown.

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
1212
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
1313
<PackageReference Include="Selenium.Support" Version="4.5.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.6.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.7.0" />
1515
<PackageReference Include="WebDriverManager" Version="2.16.0" />
1616
</ItemGroup>
1717

examples/java/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.6.0'
14-
testImplementation 'org.seleniumhq.selenium:selenium-grid:4.6.0'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.7.0'
14+
testImplementation 'org.seleniumhq.selenium:selenium-grid:4.7.0'
1515
testImplementation 'io.github.bonigarcia:webdrivermanager:5.2.3'
1616
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
1717
}

examples/java/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
<dependency>
2323
<groupId>org.seleniumhq.selenium</groupId>
2424
<artifactId>selenium-java</artifactId>
25-
<version>4.6.0</version>
25+
<version>4.7.0</version>
2626
</dependency>
2727
<dependency>
2828
<groupId>org.seleniumhq.selenium</groupId>
2929
<artifactId>selenium-grid</artifactId>
30-
<version>4.6.0</version>
30+
<version>4.7.0</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>org.slf4j</groupId>
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package dev.selenium.browsers;
22

3-
import io.github.bonigarcia.wdm.WebDriverManager;
43
import org.junit.jupiter.api.AfterEach;
5-
import org.junit.jupiter.api.BeforeAll;
64
import org.junit.jupiter.api.Test;
75
import org.junit.jupiter.api.condition.EnabledOnOs;
86
import org.junit.jupiter.api.condition.OS;
@@ -13,11 +11,6 @@
1311
public class InternetExplorerTest {
1412
public InternetExplorerDriver driver;
1513

16-
@BeforeAll
17-
public static void setDriver() {
18-
WebDriverManager.iedriver().setup();
19-
}
20-
2114
@AfterEach
2215
public void quit() {
2316
driver.quit();
@@ -26,7 +19,6 @@ public void quit() {
2619
@Test
2720
public void basicOptions() {
2821
InternetExplorerOptions options = new InternetExplorerOptions();
29-
options.ignoreZoomSettings();
3022
driver = new InternetExplorerDriver(options);
3123
}
3224
}

examples/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"assert": "^2.0.0",
1212
"chromedriver": "^106.0.1",
1313
"geckodriver": "^3.0.2",
14-
"selenium-webdriver": "^4.5.0"
14+
"selenium-webdriver": "^4.7.0"
1515
},
1616
"devDependencies": {
1717
"mocha": "^10.0.0"

examples/kotlin/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<slf4j.version>1.7.36</slf4j.version>
1515
<logback.version>1.2.11</logback.version>
1616

17-
<selenium.version>4.5.0</selenium.version>
1817
<junit5.version>5.9.0</junit5.version>
1918
<wdm.version>5.2.3</wdm.version>
2019

@@ -44,7 +43,7 @@
4443
<dependency>
4544
<groupId>org.seleniumhq.selenium</groupId>
4645
<artifactId>selenium-java</artifactId>
47-
<version>${selenium.version}</version>
46+
<version>4.7.0</version>
4847
<scope>test</scope>
4948
</dependency>
5049
<dependency>

examples/kotlin/src/test/kotlin/dev/selenium/getting_started/OpenBrowserTest.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ class OpenBrowserTest {
5050
driver.quit()
5151
}
5252

53-
@Disabled("Only runs on Windows")
54-
@Test
55-
fun internetExplorerCompatibilitySession() {
56-
val options = InternetExplorerOptions()
57-
options.attachToEdgeChrome()
58-
options.withEdgeExecutablePath("/path/to/edge/browser")
59-
driver = InternetExplorerDriver(options)
60-
driver.quit()
61-
}
62-
6353
@Disabled("Requires non-standard browser")
6454
@Test
6555
fun operaSession() {

examples/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
selenium==4.6.0
1+
selenium==4.7.2
22
pytest
33
flake8
44
webdriver_manager==3.8.3
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
import os
21
import sys
32

43
import pytest
54
from selenium import webdriver
65
from selenium.webdriver.ie.options import Options as InternetExplorerOptions
7-
from selenium.webdriver.ie.service import Service as InternetExplorerService
8-
from webdriver_manager.microsoft import IEDriverManager
96

107

118
@pytest.mark.skipif(sys.platform != "win32", reason="requires Windows")
129
def test_basic_options():
13-
service = InternetExplorerService(executable_path=IEDriverManager().install())
1410
options = InternetExplorerOptions()
15-
options.ignore_zoom_level = True
16-
driver = webdriver.Ie(options=options, service=service)
11+
driver = webdriver.Ie(options=options)
1712

1813
driver.quit()

examples/ruby/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ gem 'rake', '~> 13.0'
77
gem 'rspec', '~> 3.0'
88
gem 'rubocop', '~> 1.35'
99
gem 'rubocop-rspec', '~> 2.12'
10-
gem 'selenium-webdriver', '= 4.6.1'
10+
gem 'selenium-webdriver', '= 4.7.1'
1111
gem 'webdrivers', '~> 5.1'
1212
gem 'ffi', '~> 1.15', '>= 1.15.5'

examples/ruby/Gemfile.lock

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
ast (2.4.2)
5-
childprocess (4.1.0)
65
diff-lcs (1.5.0)
76
ffi (1.15.5)
87
json (2.6.2)
@@ -11,49 +10,48 @@ GEM
1110
nokogiri (1.13.9-x86_64-linux)
1211
racc (~> 1.4)
1312
parallel (1.22.1)
14-
parser (3.1.2.1)
13+
parser (3.1.3.0)
1514
ast (~> 2.4.1)
1615
racc (1.6.0)
1716
rainbow (3.1.1)
1817
rake (13.0.6)
19-
regexp_parser (2.5.0)
18+
regexp_parser (2.6.1)
2019
rexml (3.2.5)
21-
rspec (3.11.0)
22-
rspec-core (~> 3.11.0)
23-
rspec-expectations (~> 3.11.0)
24-
rspec-mocks (~> 3.11.0)
25-
rspec-core (3.11.0)
26-
rspec-support (~> 3.11.0)
27-
rspec-expectations (3.11.1)
20+
rspec (3.12.0)
21+
rspec-core (~> 3.12.0)
22+
rspec-expectations (~> 3.12.0)
23+
rspec-mocks (~> 3.12.0)
24+
rspec-core (3.12.0)
25+
rspec-support (~> 3.12.0)
26+
rspec-expectations (3.12.0)
2827
diff-lcs (>= 1.2.0, < 2.0)
29-
rspec-support (~> 3.11.0)
30-
rspec-mocks (3.11.1)
28+
rspec-support (~> 3.12.0)
29+
rspec-mocks (3.12.0)
3130
diff-lcs (>= 1.2.0, < 2.0)
32-
rspec-support (~> 3.11.0)
33-
rspec-support (3.11.1)
34-
rubocop (1.36.0)
31+
rspec-support (~> 3.12.0)
32+
rspec-support (3.12.0)
33+
rubocop (1.39.0)
3534
json (~> 2.3)
3635
parallel (~> 1.10)
3736
parser (>= 3.1.2.1)
3837
rainbow (>= 2.2.2, < 4.0)
3938
regexp_parser (>= 1.8, < 3.0)
4039
rexml (>= 3.2.5, < 4.0)
41-
rubocop-ast (>= 1.20.1, < 2.0)
40+
rubocop-ast (>= 1.23.0, < 2.0)
4241
ruby-progressbar (~> 1.7)
4342
unicode-display_width (>= 1.4.0, < 3.0)
44-
rubocop-ast (1.21.0)
43+
rubocop-ast (1.24.0)
4544
parser (>= 3.1.1.0)
46-
rubocop-rspec (2.13.1)
45+
rubocop-rspec (2.15.0)
4746
rubocop (~> 1.33)
4847
ruby-progressbar (1.11.0)
4948
rubyzip (2.3.2)
50-
selenium-webdriver (4.6.1)
51-
childprocess (>= 0.5, < 5.0)
49+
selenium-webdriver (4.7.1)
5250
rexml (~> 3.2, >= 3.2.5)
5351
rubyzip (>= 1.2.2, < 3.0)
5452
websocket (~> 1.0)
5553
unicode-display_width (2.3.0)
56-
webdrivers (5.1.0)
54+
webdrivers (5.2.0)
5755
nokogiri (~> 1.6)
5856
rubyzip (>= 1.3.0)
5957
selenium-webdriver (~> 4.0)
@@ -70,7 +68,7 @@ DEPENDENCIES
7068
rspec (~> 3.0)
7169
rubocop (~> 1.35)
7270
rubocop-rspec (~> 2.12)
73-
selenium-webdriver (= 4.6.1)
71+
selenium-webdriver (= 4.7.1)
7472
webdrivers (~> 5.1)
7573

7674
BUNDLED WITH
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# frozen_string_literal: true
22

33
require 'spec_helper'
4-
require 'webdrivers'
54

65
RSpec.describe 'Internet Explorer', exclusive: {platform: :windows} do
76
it 'basic options' do
8-
options = Selenium::WebDriver::Options.ie(ignore_zoom_level: true)
7+
options = Selenium::WebDriver::Options.ie
98
@driver = Selenium::WebDriver.for :ie, options: options
109
end
1110
end

website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,16 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b
2929

3030
{{< tabpane code=false langEqualsHeader=true >}}
3131
{{< tab header="Java" >}}
32-
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}}
32+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#21-L22" >}}
3333
{{< /tab >}}
3434
{{% tab header="Python" %}}
35-
Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}})
36-
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}}
35+
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L10-L11" >}}
3736
{{% /tab %}}
3837
{{% tab header="CSharp" %}}
39-
Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}})
40-
does not support Internet Explorer, so the location must be in a
41-
[directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}),
42-
or specified explicitly as in this example.
43-
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}}
38+
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L16-L17" >}}
4439
{{% /tab %}}
4540
{{< tab header="Ruby" >}}
46-
{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}}
41+
{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L7-L8" >}}
4742
{{< /tab >}}
4843
{{< tab header="JavaScript" code=true >}}
4944
let driver = await new Builder()
@@ -53,8 +48,6 @@ or specified explicitly as in this example.
5348
{{< /tab >}}
5449
{{< tab header="Kotlin" code=true >}}
5550
val options = InternetExplorerOptions()
56-
options.attachToEdgeChrome()
57-
options.withEdgeExecutablePath("/path/to/edge/browser")
5851
val driver = InternetExplorerDriver(options)
5952
{{< /tab >}}
6053
{{< /tabpane >}}
@@ -65,6 +58,9 @@ use the two parameters above. IE Driver will use Edge and will automatically loc
6558
* If IE and Edge are both present on the system, you only need to set attaching to Edge,
6659
IE Driver will automatically locate Edge on your system.
6760

61+
As of Internet Explorer Driver v4.7.0:
62+
* No longer need to set Ignore Zoom Level for Edge in IE Mode
63+
6864
Here are a few common use cases with different capabilities:
6965

7066
### fileUploadDialogTimeout

website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,16 @@ Starting a Microsoft Edge browser in Internet Explorer Compatibility mode with b
2929

3030
{{< tabpane code=false langEqualsHeader=true >}}
3131
{{< tab header="Java" >}}
32-
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#28-L30" >}}
32+
{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#21-L22" >}}
3333
{{< /tab >}}
3434
{{% tab header="Python" %}}
35-
Note that Python must specify service class for IE to use [Driver Manager]({{< ref "../getting_started/install_drivers.md" >}})
36-
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L13-L16" >}}
35+
{{< gh-codeblock path="/examples/python/tests/browsers/test_internet_explorer.py#L10-L11" >}}
3736
{{% /tab %}}
3837
{{% tab header="CSharp" %}}
39-
Note that the .NET [Driver Manager]({{< ref "../getting_started/install_drivers#1-driver-management-software" >}})
40-
does not support Internet Explorer, so the location must be in a
41-
[directory on PATH]({{< ref "../getting_started/install_drivers#2-the-path-environment-variable" >}}),
42-
or specified explicitly as in this example.
43-
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L24-L30" >}}
38+
{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L16-L17" >}}
4439
{{% /tab %}}
4540
{{< tab header="Ruby" >}}
46-
{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L8-L9" >}}
41+
{{< gh-codeblock path="/examples/ruby/spec/browsers/internet_explorer_spec.rb#L7-L8" >}}
4742
{{< /tab >}}
4843
{{< tab header="JavaScript" code=true >}}
4944
let driver = await new Builder()
@@ -53,8 +48,6 @@ or specified explicitly as in this example.
5348
{{< /tab >}}
5449
{{< tab header="Kotlin" code=true >}}
5550
val options = InternetExplorerOptions()
56-
options.attachToEdgeChrome()
57-
options.withEdgeExecutablePath("/path/to/edge/browser")
5851
val driver = InternetExplorerDriver(options)
5952
{{< /tab >}}
6053
{{< /tabpane >}}
@@ -65,6 +58,9 @@ use the two parameters above. IE Driver will use Edge and will automatically loc
6558
* If IE and Edge are both present on the system, you only need to set attaching to Edge,
6659
IE Driver will automatically locate Edge on your system.
6760

61+
As of Internet Explorer Driver v4.7.0:
62+
* No longer need to set Ignore Zoom Level for Edge in IE Mode
63+
6864
Here are a few common use cases with different capabilities:
6965

7066
### fileUploadDialogTimeout

0 commit comments

Comments
 (0)