Skip to content

Commit 4059519

Browse files
committed
restore msedgedriver functionality to Selenium Manager
1 parent 765704f commit 4059519

File tree

5 files changed

+43
-4
lines changed

5 files changed

+43
-4
lines changed

dotnet/src/webdriver/SeleniumManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public static class SeleniumManager
3535
private static string binary;
3636
private static readonly List<string> KnownDrivers = new List<string>() {
3737
"geckodriver.exe",
38-
"chromedriver.exe"
38+
"chromedriver.exe",
39+
"msedgedriver.exe"
3940
};
4041

4142
/// <summary>

java/src/org/openqa/selenium/manager/SeleniumManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private File getBinary() {
144144
* @return the location of the driver.
145145
*/
146146
public String getDriverPath(String driverName) {
147-
if (!ImmutableList.of("geckodriver", "chromedriver").contains(driverName)) {
147+
if (!ImmutableList.of("geckodriver", "chromedriver", "msedgedriver").contains(driverName)) {
148148
throw new WebDriverException("Unable to locate driver with name: " + driverName);
149149
}
150150

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def driver_location(browser: str) -> str:
6060
- browser: which browser to get the driver path for.
6161
:Returns: The driver path to use
6262
"""
63-
if browser not in ("chrome", "firefox"):
63+
if browser not in ("chrome", "firefox", "edge"):
6464
raise WebDriverException(f"Unable to locate driver associated with browser name: {browser}")
6565

6666
args = (str(SeleniumManager.get_binary()), "--browser", browser)

rb/lib/selenium/webdriver/common/selenium_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class << self
3131
# @return [String] the path to the correct driver.
3232
def driver_path(driver_name)
3333
@driver_path ||= begin
34-
unless %w[chromedriver geckodriver].include?(driver_name)
34+
unless %w[chromedriver geckodriver msedgedriver].include?(driver_name)
3535
msg = "Unable to locate driver with name: #{driver_name}"
3636
raise Error::WebDriverError, msg
3737
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# frozen_string_literal: true
2+
3+
# Licensed to the Software Freedom Conservancy (SFC) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The SFC licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
require_relative '../spec_helper'
21+
22+
module Selenium
23+
module WebDriver
24+
module Edge
25+
describe Service, exclusive: {browser: :edge} do
26+
let(:service) { Service.new }
27+
let(:service_manager) { service.launch }
28+
29+
after { service_manager.stop }
30+
31+
it 'auto uses edgedriver' do
32+
allow(Platform).to receive(:find_binary)
33+
expect(service_manager.uri).to be_a(URI)
34+
end
35+
end
36+
end # Edge
37+
end # WebDriver
38+
end # Selenium

0 commit comments

Comments
 (0)