または、メールフィールドの移行を変更します。
概要
古いマシンで Selenium::WebDriver::Remote::Capabilities.chrome が返す
#<Selenium::WebDriver::Remote::Capabilities:0x00007fe9d10e66f0 @capabilities={:browser_name=>“chrome”}>
新しいマシンの返品時
新しいマシンの返品時
最近新しい Mac (macos Ventura) を入手し、すべてのテストを実行できるようにしようとしています。 (古いマシンで実行されるテスト)
chromedriver をダウンロードしてテストを開始すると、watir gem から「未定義のメソッド ‘chrome’」が表示されます。
エラーの原因を追跡して、watir-6.19.1/lib/watir/capabilities.rb:93 のメソッド process_capabilities を追跡しました。そこの線は caps = Selenium::WebDriver::Remote::Capabilities.send @browser、@options.merge(@w3c_caps)。 @browser = :chrome, @options = {} << デフォルト設定
chromedriver に問題があるのではないかと思いましたが、ローカルで起動でき、chromedrive は PATH にあります。
irb で watir インスタンスを開始しようとしましたが、同じエラーが発生しました。
どのクロームドライバー /opt/homebrew/bin/chromedriver
echo /Users/itayayuuicularu/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/bin:/Users/itayayuuicularu/.rbenv/versions/3.3.1/bin:/usr/local/Cellar/ rbenv/1.2.0/libexec:/Users/itayayuuicularu/Library/Caches/fnm_multishells/33854_1716205101510/bin:/Users/itayayuuicularu/Library/Application Support/fnm:/opt/homebrew/opt/openssl@3/bin:/Users /itayayuuichirou/Library/Caches/fnm_multishells/33805_1716205101477/bin:/Users/itayayuuicularu/.rbenv/shims:/Users/itayayuuicularu/.nodebrew/current/bin:/usr/local/opt/php@7.4/sbin:/usr /local/opt/php@7.4/bin:/usr/local/opt/libxml2/bin:/Users/itayayuuicularu/.phpenv/shims:/opt/homebrew/opt/tidy-html5/lib:/opt/homebrew/ opt/icu4c/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/krb5/bin:/opt/homebrew/opt/libiconv/bin:/opt/homebrew/opt/curl/ bin:/opt/homebrew/opt/bzip2/bin:/opt/homebrew/opt/libxml2/bin:/opt/homebrew/opt/bison/bin:/Users/itayayuuichirou/.phpenv/bin:/Users/itayayuuofficial/ bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex .system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system /bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/itayayuuicularu/.fzf/bin:/Users/itayayuuofficial/Documents/SDKs/flutter/bin /Users/charlie.alderete/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/ bin:/usr/sbin:/sbin
クロムドライバー ポート 9515 で ChromeDriver 117.0.5938.88 (be6afae4721209be42944bbcd325665f9f44563b-refs/branch-heads/5938_62@{#9}) を開始します ローカル接続のみが許可されます。 ChromeDriver を安全に保つための提案については、https://chromedriver.chromium.org/security-considerations をご覧ください。 ChromeDriver が正常に起動されました。
クロムドライバー ポート 9515 で ChromeDriver 117.0.5938.88 (be6afae4721209be42944bbcd325665f9f44563b-refs/branch-heads/5938_62@{#9}) を開始します ローカル接続のみが許可されます。 ChromeDriver を安全に保つための提案については、https://chromedriver.chromium.org/security-considerations をご覧ください。 ChromeDriver が正常に起動されました。
解決策
Watir 7 にアップグレードするか、Selenium のバージョンをダウングレードする必要があります。 Selenium は、許可するメソッドを変更しました。 Watir 7 には互換性がありますが、Watir 6 には互換性がありません。