gems/ruby/2.2.0/gems/watir-webdriver-0.7.0/lib/watir-webdriver/extensions/alerts.rb
#
# Overwrite window.prompt()
#
# This method is provided by an optional require - API is subject to change.
#
Overwrite window.prompt()
This method is provided by an optional require - API is subject to change.
Overwrite window . prompt () This method is provided by an optional require - API is subject to change .
def prompt(answer, &blk)
      warn 'AlertHelper is deprecated. Use the new Alert API instead (e.g. browser.alert.ok)'
      execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{MultiJson.encode answer}; }"
      yield
      result = execute_script "return window.__lastWatirPrompt"
      result && result.dup.each_key { |k| result[k.to_sym] = result.delete(k)}
      result
    end
def prompt ( answer , & blk ) warn 'AlertHelper is deprecated. Use the new Alert API instead (e.g. browser.alert.ok)' execute_script "window.prompt = function(text, value) { window.__lastWatirPrompt = { message: text, default_value: value }; return #{MultiJson.encode answer}; }" yield result = execute_script "return window.__lastWatirPrompt" result && result . dup . each_key { | k | result [ k . to_sym ] = result . delete ( k ) } result end
Overwrite window.prompt()
This method is provided by an optional require - API is subject to change.
Overwrite window . prompt () This method is provided by an optional require - API is subject to change .
answer
<not_specific>
blk
<not_specific>