Hi,
I have a main window. A popup(new window) comes up. I attach that
popup to my main window, then I verify some text in that popup. Now I
would like to close that popup and return to my Main window. In IE,
the below script works very well but in firefox, somehow the main
window is lost once I run the attach statement. Below is my code. Any
help is appreciated:
------------------------------
require 'rubygems'
require 'watir'
require 'firewatir'
Watir::Browser.default="firefox"
b=Watir::Browser.new
b.goto "http://citi.com";
if b.link(:text,"Privacy").exists?
        b.link(:text,"Privacy").click
        sleep 10
        if (Watir::Browser.default) == "firefox"
                b2=FireWatir::Firefox.attach(:title,"Citibank Online - Privacy")
        else
                if (b2=Watir::IE.find(:title,"Citibank Online - Privacy")) == 
nil
                        puts "couldn't find the browser"
                else
                        b2=Watir::IE.attach(:title,"Citibank Online - Privacy")
                end
        end
        if b2.title == "Citibank Online - Privacy"
                puts "popup opened"
        else
                puts "couldnt find the popup"
        end
        b2.close
else
        puts "privacy not found"
end
if b.link(:text,"Citi.com").exists?
        b.link(:text,"Citi.com").click
        puts "Main browser still active"
else
        puts "Main browser is lost"
end

----------------------------
After I run this script, in IE, my output is
"popup opened
Main browser still active"
But if I run this script in firefox, my output is
"popup opened
Main browser is lost"

I would like to know, if I can close or ignore a popup in firefox and
come back to main window.
Thanks


-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

Reply via email to