Module: ButtonHelper

Defined in:
lib/watir_helper/button_helper.rb

Instance Method Summary collapse

Instance Method Details

#click_button(browser_handle, property, property_value) ⇒ Object

Click a button.



9
10
11
# File 'lib/watir_helper/button_helper.rb', line 9

def click_button(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).click
end

#click_button_with_popup(browser_handle, property, property_value) ⇒ Object

Click a button ,after clicking which a pop-up will come.



14
15
16
# File 'lib/watir_helper/button_helper.rb', line 14

def click_button_with_popup(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).click_no_wait
end

#double_click_button(browser_handle, property, property_value) ⇒ Object

Double Click a button.



19
20
21
# File 'lib/watir_helper/button_helper.rb', line 19

def double_click_button(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).fire_event("ondblclick")
end

#double_click_button_with_popup(browser_handle, property, property_value) ⇒ Object

Double Click a button, after clicking it a pop-up will come.



24
25
26
# File 'lib/watir_helper/button_helper.rb', line 24

def double_click_button_with_popup(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).fire_event_no_wait("ondblclick")
end

#exists_button?(browser_handle, property, property_value) ⇒ Boolean

Check whether a button exists or not.

Returns:

  • (Boolean)


34
35
36
# File 'lib/watir_helper/button_helper.rb', line 34

def exists_button?(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).exists?
end

#flash_button(browser_handle, property, property_value) ⇒ Object

Highlight or Flash a button.



29
30
31
# File 'lib/watir_helper/button_helper.rb', line 29

def flash_button(browser_handle, property, property_value)
  browser_handle.button(property.intern, /#{property_value}/).flash
end