Skip to content

Commit 7eebf9f

Browse files
committed
[rb] do not memoize driver path class method
allow using more than one browser session in the same program execution
1 parent 04d5712 commit 7eebf9f

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,16 @@ class << self
3333
# @param [String] driver_name which driver to use.
3434
# @return [String] the path to the correct driver.
3535
def driver_path(driver_name)
36-
@driver_path ||= begin
37-
unless %w[chromedriver geckodriver msedgedriver IEDriverServer].include?(driver_name)
38-
msg = "Unable to locate driver with name: #{driver_name}"
39-
raise Error::WebDriverError, msg
40-
end
36+
unless %w[chromedriver geckodriver msedgedriver IEDriverServer].include?(driver_name)
37+
msg = "Unable to locate driver with name: #{driver_name}"
38+
raise Error::WebDriverError, msg
39+
end
4140

42-
location = run("#{binary} --driver #{driver_name}")
43-
WebDriver.logger.debug("Driver found at #{location}")
44-
Platform.assert_executable location
41+
location = run("#{binary} --driver #{driver_name}")
42+
WebDriver.logger.debug("Driver found at #{location}")
43+
Platform.assert_executable location
4544

46-
location
47-
end
45+
location
4846
end
4947

5048
private

0 commit comments

Comments
 (0)