System: Window 7 Internet Explorer 8 Ruby 1.8 Watir 1.6.5
If I manually open a browser window, and then go to the site that causes the second browser window to open, and then use the Watir :: IE.attach method to find the second browser window, everything works fine. The problem is that I open the first Internet Explorer window using the Watir :: IE.new command, and then go to the site that causes the second browser window to open. When I use Watir :: IE.attach to find the second browser window, I now get: Watir :: Exception :: NoMatchingWindowFoundException: Can't place the window with the title (? -Mix: x) from / ie -class.rb: 297 : in 'attach_browser_window' by / ie -class.rb: 149: in '_attach_init' by / ie -class.rb: 143: by 'attach' by (irb): 15
Has anyone encountered this problem and developed a solution?
I did a bit more research, and I run my script as administrator, and it opens IE8 as an administrator, and then tries to open a new window. I tried to open IE8 as an administrator manually, and then open a new window from the browser, and then run the attach command using watir, and I made the same mistake as if I created the initial window using watir.
I want to be able to run my script as an administrator.
I tried to execute the watir command manually and also run in the script:
========================
rubygems required
watir is required
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 /)
========================
source share