Class: WebDriverManager::IEDriver
- Inherits:
-
Object
- Object
- WebDriverManager::IEDriver
show all
- Extended by:
- Support
- Defined in:
- lib/webdriver_manager/drivers/driver_ie.rb
Class Method Summary
collapse
Methods included from Support
latest_binary, provision, provision_driver, remove_binary
Class Method Details
.current_binary ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 8
def current_binary
WebDriverManager.logger.debug("Checking Current Driver Version")
return nil unless driver_is_downloaded?
binary_version = `#{driver_binary} --version`
WebDriverManager.logger.debug(
"Current version of #{driver_binary} is #{binary_version}"
)
normalize(
binary_version.match(/IEDriverServer.exe (\d\.\d+\.\d*\.\d*)/)[1]
)
end
|
.driver_base_url ⇒ Object
28
29
30
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 28
def driver_base_url
"http://selenium-release.storage.googleapis.com"
end
|
.driver_binary_list ⇒ Object
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 32
def driver_binary_list
unless driver_url_is_reachable?
raise StandardError, "Unable to Access the Driver URL"
end
@binaries ||= begin
files = process_binary_files
process_binary_versions(files)
end
end
|
.driver_name ⇒ Object
24
25
26
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 24
def driver_name
"IEDriverServer.exe"
end
|
.normalize(string) ⇒ Object
20
21
22
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 20
def normalize(string)
string.to_f
end
|
.process_binary_files ⇒ Object
43
44
45
46
47
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 43
def process_binary_files
resource = Nokogiri::XML.parse(get(driver_base_url))
files = resource.css("Key").collect(&:text)
files.select! { |file| file.include?("IEDriverServer_Win32") }
end
|
.process_binary_versions(files) ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/webdriver_manager/drivers/driver_ie.rb', line 49
def process_binary_versions(files)
binary_list = files.each_with_object({}) do |file, binary|
version = normalize(file[%r{^[^\/]+}])
binary[version] = "#{driver_base_url}/#{file}"
end
WebDriverManager.logger.debug(
"Versions Located at Driver URL: #{binary_list.keys}"
)
binary_list
end
|