Skip to content

Commit 8345a87

Browse files
committed
[rb] add error messages for when devtools is not supported
1 parent 9c9dccf commit 8345a87

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

rb/lib/selenium/webdriver/firefox/driver.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ def browser
4242
private
4343

4444
def devtools_url
45+
if capabilities['moz:debuggerAddress'].nil?
46+
raise(Error::WebDriverError, "DevTools is not supported by this version of Firefox; use v85 or higher")
47+
end
48+
4549
uri = URI("http://#{capabilities['moz:debuggerAddress']}")
4650
response = Net::HTTP.get(uri.hostname, '/json/version', uri.port)
4751

rb/lib/selenium/webdriver/remote/driver.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def devtools_url
5252
end
5353

5454
def devtools_version
55-
capabilities['se:cdpVersion'].split('.').first
55+
capabilities['se:cdpVersion']&.split('.')&.first ||
56+
raise(Error::WebDriverError, "DevTools is not supported by the Remote Server")
5657
end
5758
end # Driver
5859
end # Remote

0 commit comments

Comments
 (0)