Commit 0745668
authored
[ruby] Fix devtools version fallback (#11869)
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 test1 parent a9fd3cf commit 0745668
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
32 | 57 | | |
33 | 58 | | |
34 | 59 | | |
| |||
0 commit comments