If I switch windows, for example to close a popup window, I'm unable to switch 
back to the original window and interact with it. This happens in both chrome 
and firefox when using Ubuntu 12.04 but NOT when using Windows 7. 

Here's an example script that causes the error:

require 'rubygems'
require 'watir-webdriver'

browser = Watir::Browser.new :firefox

browser.goto "http://www.artbracket.com";
                
#wait for page to load
browser.wait_until { browser.body.exists? }
                
#close any popup windows
while browser.windows.size > 1
        browser.windows.each_with_index do |w, index|
                unless index==0 then w.close end                
        end
end

#switch back to first window
browser.windows.first.use

if browser.link(:href => /opensocial/i).exists? then browser.link(:href => 
/opensocial/i).click end

Here's the output:

[remote server] 
file:///tmp/webdriver-profile20130917-19686-zez2wx/extensions/[email protected]/components/command_processor.js:8225:in
 `fxdriver.preconditions.visible': Element is not currently visible and so may 
not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)
        from [remote server] 
file:///tmp/webdriver-profile20130917-19686-zez2wx/extensions/[email protected]/components/command_processor.js:10816:in
 `DelayedCommand.prototype.checkPreconditions_'
        from [remote server] 
file:///tmp/webdriver-profile20130917-19686-zez2wx/extensions/[email protected]/components/command_processor.js:10833:in
 `DelayedCommand.prototype.executeInternal_/h'
        from [remote server] 
file:///tmp/webdriver-profile20130917-19686-zez2wx/extensions/[email protected]/components/command_processor.js:10838:in
 `DelayedCommand.prototype.executeInternal_'
        from [remote server] 
file:///tmp/webdriver-profile20130917-19686-zez2wx/extensions/[email protected]/components/command_processor.js:10780:in
 `DelayedCommand.prototype.execute/<'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/response.rb:51:in
 `assert_ok'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/response.rb:15:in
 `initialize'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/http/common.rb:59:in
 `new'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/http/common.rb:59:in
 `create_response'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/http/default.rb:66:in
 `request'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/http/common.rb:40:in
 `call'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/bridge.rb:634:in
 `raw_execute'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/bridge.rb:612:in
 `execute'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/remote/bridge.rb:369:in
 `clickElement'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/selenium-webdriver-2.35.1/lib/selenium/webdriver/common/element.rb:54:in
 `click'
        from 
/home/system/.rvm/gems/ruby-2.0.0-p0/gems/watir-webdriver-0.6.4/lib/watir-webdriver/elements/element.rb:131:in
 `click'
        from test.rb:356:in `<main>'

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/issues/220
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to