Module: PopupHelper

Defined in:
lib/watir_helper/popup_handling_helper.rb

Instance Method Summary collapse

Instance Method Details

#click_button_popup(title, button_id) ⇒ Object

Click a button on a pop-up.



11
12
13
14
# File 'lib/watir_helper/popup_handling_helper.rb', line 11

def click_button_popup(title, button_id)
  window = RAutomation::Window.new(:title => /#{title}/)
  window.button(:value => /#{button_id}/).click
end

#click_button_saveas_or_openas_popup(title, file_path, button_id) ⇒ Object

Click a button on ‘Save As’ or ‘Open As’ pop-up’s.



66
67
68
69
70
# File 'lib/watir_helper/popup_handling_helper.rb', line 66

def click_button_saveas_or_openas_popup(title, file_path, button_id)
  window = RAutomation::Window.new :title => /#{title}/
  window.text_field(:class => "Edit").set file_path
  window.button(:value => /#{button_id}/).click
end

#click_cancel_file_dialog_popup(title) ⇒ Object

Click “Cancel” button on a file dialog pop-up.



54
55
56
# File 'lib/watir_helper/popup_handling_helper.rb', line 54

def click_cancel_file_dialog_popup(title)
  click_button_popup(title, "Cancel")
end

#click_cancel_js_popup(title) ⇒ Object

Click “Cancel” button on a javascript pop-up.



22
23
24
# File 'lib/watir_helper/popup_handling_helper.rb', line 22

def click_cancel_js_popup(title)
  click_button_popup(title, "Cancel")
end

#click_cancel_openas_popup(title, open_file_path) ⇒ Object

Click “Cancel” button on ‘Open As’ pop-up’s.



88
89
90
# File 'lib/watir_helper/popup_handling_helper.rb', line 88

def click_cancel_openas_popup(title, open_file_path)
  click_button_saveas_or_openas_popup(title, open_file_path, "Cancel")
end

#click_cancel_saveas_popup(title, save_file_path) ⇒ Object

Click “Cancel” button on ‘Save As’ pop-up’s.



78
79
80
# File 'lib/watir_helper/popup_handling_helper.rb', line 78

def click_cancel_saveas_popup(title, save_file_path)
  click_button_saveas_or_openas_popup(title, save_file_path, "Cancel")
end

#click_no_js_popup(title) ⇒ Object

Click “No” button on a javascript pop-up.



37
38
39
# File 'lib/watir_helper/popup_handling_helper.rb', line 37

def click_no_js_popup(title)
  click_button_popup(title, "&No")
end

#click_ok_js_popup(title) ⇒ Object

Click “OK” button on a javascript pop-up.



17
18
19
# File 'lib/watir_helper/popup_handling_helper.rb', line 17

def click_ok_js_popup(title)
  click_button_popup(title, "OK")
end

#click_open_file_dialog_popup(title) ⇒ Object

Click “Open” button on a file dialog pop-up.



44
45
46
# File 'lib/watir_helper/popup_handling_helper.rb', line 44

def click_open_file_dialog_popup(title)
  click_button_popup(title, "&Open")
end

#click_open_openas_popup(title, open_file_path) ⇒ Object

Click “Open” button on ‘Open As’ pop-up’s.



83
84
85
# File 'lib/watir_helper/popup_handling_helper.rb', line 83

def click_open_openas_popup(title, open_file_path)
  click_button_saveas_or_openas_popup(title, open_file_path, "&Open")
end

#click_run_file_dialog_popup(title) ⇒ Object

Click “Run” button on a file dialog pop-up.



59
60
61
# File 'lib/watir_helper/popup_handling_helper.rb', line 59

def click_run_file_dialog_popup(title)
  click_button_popup(title, "&Run")
end

#click_save_file_dialog_popup(title) ⇒ Object

Click “Save” button on a file dialog pop-up.



49
50
51
# File 'lib/watir_helper/popup_handling_helper.rb', line 49

def click_save_file_dialog_popup(title)
  click_button_popup(title, "&Save")
end

#click_save_saveas_popup(title, save_file_path) ⇒ Object

Click “Save” button on ‘Save As’ pop-up’s.



73
74
75
# File 'lib/watir_helper/popup_handling_helper.rb', line 73

def click_save_saveas_popup(title, save_file_path)
  click_button_saveas_or_openas_popup(title, save_file_path, "&Save")
end

#click_yes_js_popup(title) ⇒ Object

Click “Yes” button on a javascript pop-up.



27
28
29
# File 'lib/watir_helper/popup_handling_helper.rb', line 27

def click_yes_js_popup(title)
  click_button_popup(title, "&Yes")
end

#click_yes_to_all_js_popup(title) ⇒ Object

Click “Yes” button on a javascript pop-up.



32
33
34
# File 'lib/watir_helper/popup_handling_helper.rb', line 32

def click_yes_to_all_js_popup(title)
  click_button_popup(title, "Yes To &All")
end