You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix ruby devtools version fallback
When using the feature added in #11827 that loads devtools methods
possibly a version or two earlier than was necessary asked for, i was
seeing this error:
```
NoMethodError: undefined method `get_targets' for nil:NilClass
./rb/lib/selenium/webdriver/devtools.rb:75:in `start_session'
./rb/lib/selenium/webdriver/devtools.rb:34:in `initialize'
./rb/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb:35:in `new'
./rb/lib/selenium/webdriver/common/driver_extensions/has_devtools.rb:35:in `devtools'
```
because `target` was nil because it was trying to load a class named:
```
Selenium::DevTools::V#{Selenium::DevTools.version}::#{method.capitalize}
```
which resolved to:
```
Selenium::DevTools::V112::Target
```
even though the falling-back code had already given up on 112 and loaded
111 instead.
The simplest way to fix this seems to be ensure that
`Selenium::DevTools.version` matches what was loaded.
Also now there's a test
0 commit comments