Score:0

Using Watir on WSL2 - Selenium Webdriver error

jp flag

I am using Ubuntu 22.04.1 via WSL2. Trying to use Watir to do some scraping.

This command:

a = Watir::Browser.new

results in this error:

/home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.7.1/lib/selenium/webdriver/common/driver.rb:319:in `create_bridge': unknown keyword: :desired_capabilities (ArgumentError)

        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.7.1/lib/selenium/webdriver/common/driver.rb:74:in `initialize'
        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.7.1/lib/selenium/webdriver/common/driver.rb:47:in `new'
        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.7.1/lib/selenium/webdriver/common/driver.rb:47:in `for'
        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/selenium-webdriver-4.7.1/lib/selenium/webdriver.rb:88:in `for'
        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/watir-6.19.1/lib/watir/browser.rb:46:in `initialize'
        from (irb):5:in `new'
        from (irb):5:in `<main>'
        from /home/user/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
        from /home/user/.rbenv/versions/3.1.3/bin/irb:25:in `load'
        from /home/user/.rbenv/versions/3.1.3/bin/irb:25:in `<main>'

I have installed chromedriver in /usr/bin.

Any starting point with fixing this error is appreciated.

karel avatar
sa flag
What is your Watir version? You need Watir 7 to work with Selenium 4. Please upgrade to Watir 7 or later version of Watir if you don't have Watir >= 7 installed..
Score:0
jp flag

I was able to fix this issue by update Watir.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.