watir-classic: attach to existing browser getting error

496 Views Asked by At

I am new to ruby and trying to attach to existing browser using watir-classic, but getting below exception.

Unable to locate a window with title of Google(Watir::Exception::NoMatchingWindowFoundException). 

And, i am trying with the below code:

require 'Watir-classic'
browser = Watir::Browser.attach(:title, 'Google')

What is the wrong i was doing?

and i was trying with below code for 'WATIR'

require 'watir'

browser = Watir::Browser.new( :chrome, 'chromeOptions' => {'debuggerAddress': '127.0.0.1:8081'})

enter image description here

0

There are 0 best solutions below