Intellij Idea Selenium::网络驱动程序::错误::网络驱动程序错误:返回的有效负载中没有sessionId-从ruby 2.5.3.迁移到3.1.2

wko9yo5t  于 2023-02-07  发布在  Ruby
关注(0)|答案(1)|浏览(145)

Upgraded ruby from 2.5.3 to 3.1.2 and associated gems. Cucumber tests were running fine against v 2.5.3 on chrome but now getting the below error and stack trace. Also attached my gemfile.lock
SELENIUM BROWSER: chrome CHROME PATH: /opt/google/chrome CHROME DRIVER: /home/####/git/se/acceptancetests/chromedriver
Selenium::WebDriver::Error::WebDriverError: no sessionId in returned payload /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/remote/bridge.rb:57:in create_session' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:313:in block in create_bridge' internal:kernel:90:in tap' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:312:in create_bridge' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:74:in initialize' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/chrome/driver.rb:36:in initialize' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:47:in new' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver/common/driver.rb:47:in for' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.8.0/lib/selenium/webdriver.rb:88:in for' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/selenium/driver.rb:83:in browser' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/selenium/driver.rb:137:in execute_script' /home/####/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/capybara-3.38.0/lib/capybara/session.rb:605:in execute_script' /home/####/git/see/acceptancetests/features/step_definitions/store_steps.rb:2827:in wait_for_page_load' /home/####/git/se/acceptancetests/features/support/hooks.rb:18:in AfterStep'
Gemfile.lock:
GEM remote: ### specs: addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) axe-matchers (2.6.1) dumb_delegator (~> 0.8) virtus (~> 1.0) axiom-types (0.1.1) descendants_tracker (~> 0.0.4) ice_nine (~> 0.11.0) thread_safe (~> 0.3, >= 0.3.1) builder (3.2.4) capybara (3.14.0) addressable matrix mini_mime (>= 0.1.3) nokogiri (~> 1.8) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) coercible (1.0.0) descendants_tracker (~> 0.0.1) concurrent-ruby (1.2.0) cucumber (5.3.0) builder (~> 3.2, >= 3.2.4) cucumber-ci-environment (~> 9.0, >= 9.0.4) cucumber-core (~> 11.0, >= 11.0.0) cucumber-cucumber-expressions (~> 15.1, >= 15.1.1) cucumber-gherkin (~> 23.0, >= 23.0.1) cucumber-html-formatter (~> 19.1, >= 19.1.0) cucumber-messages (~> 18.0, >= 18.0.0) diff-lcs (~> 1.5, >= 1.5.0) mime-types (~> 3.4, >= 3.4.1) multi_test (~> 1.1, >= 1.1.0) sys-uname (~> 1.2, >= 1.2.2) cucumber-ci-environment (9.1.0) cucumber-core (11.0.0) cucumber-gherkin (~> 23.0, >= 23.0.1) cucumber-messages (~> 18.0, >= 18.0.0) cucumber-tag-expressions (~> 4.1, >= 4.1.0) cucumber-cucumber-expressions (15.2.0) cucumber-gherkin (23.0.1) cucumber-messages (~> 18.0, >= 18.0.0) cucumber-html-formatter (19.2.0) cucumber-messages (~> 18.0, >= 18.0.0) cucumber-messages (18.0.0) cucumber-tag-expressions (4.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.5.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dumb_delegator (0.8.1) equalizer (0.0.11) excon (0.98.0) ffi (1.15.5) headless (2.3.1) http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.2) jwt (2.2.3) matrix (0.4.2) mime-types (3.4.1) mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_mime (1.1.2) mini_portile2 (2.6.1) multi_test (1.1.0) mysql2 (0.5.5) netrc (0.11.0) nokogiri (1.12.5) mini_portile2 (~> 2.6.1) racc (~> 1.4) parallel (1.22.1) parallel_tests (3.13.0) parallel public_suffix (5.0.1) racc (1.6.2) rack (3.0.4.1) rack-test (2.0.2) rack (>= 1.3) regexp_parser (2.6.2) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) rexml (3.2.5) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) rspec-mocks (~> 3.12.0) rspec-core (3.12.0) rspec-support (~> 3.12.0) rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-mocks (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.0) ruby-hmac (0.4.0) ruby-oci8 (2.2.12) rubyzip (2.3.2) selenium-webdriver (4.8.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) sys-uname (1.2.2) ffi (~> 1.1) thread_safe (0.3.6) unf (0.1.4) unf_ext unf_ext (0.0.8.2) virtus (1.0.5) axiom-types (~> 0.1) coercible (~> 1.0) descendants_tracker (~> 0.0, >= 0.0.3) equalizer (~> 0.0, >= 0.0.9) websocket (1.2.9) xpath (3.2.0) nokogiri (~> 1.8)
PLATFORMS ruby
DEPENDENCIES axe-matchers capybara cucumber excon headless i18n jwt (~> 2.2.2) mysql2 nokogiri (= 1.12.5)

gwo2fgha

gwo2fgha1#

这里的错误表明你没有正确地生成能力,所以很可能你对selenium所做的任何更新现在都导致你生成了一个无效的有效负载。
在 selenium 4alpha6附近发生了一些大的变化(对于v3,你可以使用desired_capabilities,但现在你只使用capabilities
如果你使用的是水豚,你可以使用gem来生成一个简单的驱动程序,只需点击一下https://github.com/site-prism/automation_helpers/blob/main/lib/automation_helpers/drivers/local.rb#L7
编辑:你的宝石也有点不匹配。你用的是最新的 selenium 驱动程序,但是水豚的版本很老。看看你能不能让它们保持相同的年龄

相关问题