Skip to content

Commit a4dac0c

Browse files
committed
add support in bindings to use Selenium Manager with Internet Explorer
1 parent 4030c40 commit a4dac0c

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

dotnet/src/webdriver/SeleniumManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public static class SeleniumManager
3636
private static readonly List<string> KnownDrivers = new List<string>() {
3737
"geckodriver",
3838
"chromedriver",
39-
"msedgedriver"
39+
"msedgedriver",
40+
"IEDriverServer"
4041
};
4142

4243
/// <summary>

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

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

javascript/node/selenium-webdriver/ie.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const remote = require('./remote')
3535
const webdriver = require('./lib/webdriver')
3636
const { Browser, Capabilities } = require('./lib/capabilities')
3737
const error = require('./lib/error')
38+
const { driverLocation } = require('./common/seleniumManager')
3839

3940
const IEDRIVER_EXE = 'IEDriverServer.exe'
4041
const OPTIONS_CAPABILITY_KEY = 'se:ieOptions'
@@ -399,6 +400,18 @@ function createServiceFromCapabilities(capabilities) {
399400
}
400401

401402
let exe = locateSynchronously()
403+
if (!exe) {
404+
console.log(
405+
`The ${IEDRIVER_EXE} executable could not be found on the current PATH, trying Selenium Manager`
406+
)
407+
408+
try {
409+
exe = driverLocation(Browser.INTERNET_EXPLORER)
410+
} catch (err) {
411+
console.log(`Unable to obtain driver using Selenium Manager: ${err}`)
412+
}
413+
}
414+
402415
if (!exe || !fs.existsSync(exe)) {
403416
throw Error(
404417
`${IEDRIVER_EXE} could not be found on the current PATH. Please ` +

py/selenium/webdriver/common/selenium_manager.py

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

6767
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
@@ -32,7 +32,7 @@ class << self
3232
# @return [String] the path to the correct driver.
3333
def driver_path(driver_name)
3434
@driver_path ||= begin
35-
unless %w[chromedriver geckodriver msedgedriver].include?(driver_name)
35+
unless %w[chromedriver geckodriver msedgedriver IEDriverServer.exe].include?(driver_name)
3636
msg = "Unable to locate driver with name: #{driver_name}"
3737
raise Error::WebDriverError, msg
3838
end

0 commit comments

Comments
 (0)