By Jack


2018-02-13 12:41:41 8 Comments

browser = Watir::Browser.new :chrome
browser = Watir::Browser.start @url = query

yml = YAML.dump(browser)
File.open("watir.obj", 'w') { |file| file.write(yml) }

#object saved ok!

#BUT PROBLEM HERE 
pp browser = YAML::load_file("watir.obj")
puts browser.html


pp will return #<Watir::Browser:0x32ef165a7e2a48ce closed=true> <<< CLOSED

if I try to second part of script - I will get error:

/Users/lir/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/net/http.rb:906:in `rescue in block in connect': Failed to open TCP connection to 127.0.0.1:9515 (Connection refused - connect(2) for "127.0.0.1" port 9515) (Errno::ECONNREFUSED)

It looks like watir cant connect to chromedriver. Yes?

0 comments

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] ruby cucumber tests on multiple browsers

0 Answered Questions

Sinatra breaks driver.navigate.to in selenium

2 Answered Questions

2 Answered Questions

Ruby/Watir - storing watir objects in hash?

0 Answered Questions

Intermittent ECONNREFUSED in selenium grid 2

2 Answered Questions

[SOLVED] Unable to rescue from Redis connection refusal

  • 2011-10-05 07:14:59
  • Carl Zulauf
  • 4200 View
  • 7 Score
  • 2 Answer
  • Tags:   ruby redis

3 Answered Questions

2 Answered Questions

[SOLVED] How would I do a while statement with net/http if it keeps timing out?

  • 2011-11-30 02:07:55
  • jrg
  • 2568 View
  • 1 Score
  • 2 Answer
  • Tags:   ruby net-http

Sponsored Content