I'm trying to attach Selenium to existing browser. Based on this tutorial, now I've got:

test.bat

cd /d "%~dp0" ruby test.rb %1 %2 %3 %input% pause

test.rb

require 'selenium-webdriver' options = Selenium::WebDriver::Options.edge options.debugger_address = '127.0.0.1:9111' puts '1' # options.detach = true driver = Selenium::WebDriver.for :edge, options: options puts '2' errors = [Selenium::WebDriver::Error::NoSuchElementError, Selenium::WebDriver::Error::ElementNotInteractableError] puts '3' wait = Selenium::WebDriver::Wait.new(timeout: 30, interval: 1, ignore: errors) puts '4' driver.get 'https://google.com/' puts 'Done'

Before running this script I'm starting edge from console.

msedge.exe --remote-debugging-port=9111 --no-first-run --no-default-browser-check --user-data-dir="C:\Users\User\AppData\Local\Microsoft\Edge\User Data"

In theory: simple script that should go to google page. In reality the script doesn't go beyond

puts '1'

It's just froze till I get ruby/3.4.0/net/protocol.rb:229:in 'Net::BufferedIO#rbuf_fill': Net::ReadTimeout with #<TCPSocket:(closed)> (Net::ReadTimeout)Any ideas why?

Shruikan's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.