From: aidy Date: 2008-04-30T21:25:04+09:00 Subject: Re: Watir : Working in same session of IE On 30 Apr, 10:52, Anukul Singhal wrote: > require 'watir' > > ie = Watir::IE.new > ie.goto("http://www.google.com") > When I execute, it successfully opens a new browser with the > correct google url. > Now, in this code, I simply want to add: > ie.text_field(:name, "q").set 'roger federer' > If I append the above line to the above code, it will open a new > session > of IE and will perform the operation of setting the text box too, > but my > objective is not to open a new IE with google url but to perform > the set command in the existing browser only. It might have been better to post this on the Watir list; you can subscribe here; http://wtr.rubyforge.org/community.html I think Ruby linguistic answers would be best answered at ruby.lang. If we look at the Watir API doc http://wtr.rubyforge.org/rdoc/ we note ie.attach "Return a Watir::IE object for an existing IE window. Window can be referenced by url, title, or window handle. Second argument can be either a string or a regular expression in the case of of :url or :title. IE.attach(:url, ‘www.google.com’) IE.attach(:title, ‘Google’) IE.attach(:hwnd, 528140) This method will not work when Watir/Ruby is run under a service (instead of a user). " Regards Aidy www.agiletester.co.uk