This question already has an answer here:
I do not want to open a new browser by @browser = Watir::Browser.new (:ie) but i want to work with manually opened browser using Watir-Webdriver. How would I do that ?
I thought it may be something like this browser(:title => "Browser Title").text_field( :id => 'Field Id').set 'abc'
it seems like I need to create an Object of browser class to work it .. Please guide me?
Selenium-webdriver does not have functionality for attaching to existing browsers. This feature was requested, but closed as not feasible (see Issue 18).
If you are only using IE, you could consider using Watir-Classic, which has functionality for attaching to existing browsers:
The main part of the API is the same between Watir-Webdriver and Watir-Classic. There are some small differences depending on what you are doing. Note that if your code is doing
require 'watir'
, you might already be using Watir-Classic.