lib/page-object/platforms/watir/page_object.rb
#
# platform method to handle a prompt popup
# See PageObject#prompt
#
platform method to handle a prompt popup
See PageObject#prompt
platform method to handle a prompt popup See PageObject#prompt
def prompt(answer, frame=nil, &block)
          switch_to_frame(frame)
          @browser.wd.execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{answer}; }"
          yield
          result = @browser.wd.execute_script "return window.__lastWatirPrompt"
          switch_to_default_content(frame)
          result && result.dup.each_key { |k| result[k.to_sym] = result.delete(k) }
          result
        end
def prompt ( answer , frame = nil , & block ) switch_to_frame ( frame ) @browser . wd . execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{answer}; }" yield result = @browser . wd . execute_script "return window.__lastWatirPrompt" switch_to_default_content ( frame ) result && result . dup . each_key { | k | result [ k . to_sym ] = result . delete ( k ) } result end
platform method to handle a prompt popup
See PageObject#prompt
platform method to handle a prompt popup See PageObject#prompt
answer
frame
block