Run the ruby process as administrator. You can do this by launching the parent cmd window as administrator, or, if you're using a shortcut, modifying the shortcut to launch the process as administrator.
On Fri, Apr 23, 2010 at 12:07, Zach Hayes <[email protected]> wrote: > Windows 7 > Internet Explorer 8 > Ruby 1.8.6 > Watir 1.6.5 > > The attach and find methods CANNOT find an IE instance that was opened > via clicking a link from another instance of IE started using “Run as > Administrator” or from a Run as Administrator command prompt run water > script. > > Here’s a simple script that demonstrates success if run as non-admin > and failure if run as admin > > require 'rubygems' > require 'watir' > ie = Watir::IE.start("http://www.quackit.com/html/codes/ > html_open_link_in_new_window.cfm") > ie.link(:text,"HTML Help").click > ie2 = Watir::IE.attach(:title,/Help/) > #ie2 = Watir::IE.find(:title,/Help/) > if ie2==nil > print "ie2 nil" > else > print "ie2 not nil" > end > > These methods both work however on finding a window opened via admin > or non-admin as long as it is the first window. Here’s a script > demonstrating success for both admin and non-admin > > require 'rubygems' > require 'watir' > ie = Watir::IE.start("google.com") > ie2 = Watir::IE.attach(:title,/Google/) > #ie2 = Watir::IE.find(:title,/Google/) > if ie2==nil > print "ie2 nil" > else > print "ie2 not nil" > end > > Has anyone run into this issue and have a solution? > > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > You received this message because you are subscribed to > http://groups.google.com/group/watir-general > To post: [email protected] > -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: [email protected]
