jarib/watir-webdriver — Issue #109: Add method to control 'Leave Page' created by defining window.onbeforeunload function
Author: Chuckv
Created: 2011-12-27 19:24:29+00:00
State: open

There is a special type of alert window, similar to a javascript confirm window which is created when someone defines a function to execute at window.onbeforeunload. This creates a browser generated modal popup regarding leaving the page and unsaved data .

See this Watir General thread: http://groups.google.com/group/watir-general/browse_thread/thread/03e5cec1fb7d2cd7/2bb085f53d3d5011#2bb085f53d3d5011

See http://www.google.com/url?sa=D&q=http://www.4guysfromrolla.com/webtech/100604-1.shtml&usg=AFQjCNFjhiVcfvbJDv1GCwjTQOSNGCH9qQ for more on how to create this kind of popup

either extending the .confirm method to deal with this, or creating a new method (.leave_page ?) that works similar to .confirm would seem the best approach to use.