Class: WindowHelper
- Inherits:
-
Object
- Object
- WindowHelper
- Defined in:
- lib/watir/WindowHelper.rb
Constant Summary collapse
- @@ie_window_name =
"Windows Internet Explorer"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ WindowHelper
constructor
A new instance of WindowHelper.
- #logon(title, name = 'john doe', password = 'john doe') ⇒ Object
- #push_alert_button ⇒ Object
- #push_confirm_button_cancel ⇒ Object
- #push_confirm_button_ok ⇒ Object
- #push_security_alert_yes ⇒ Object
Constructor Details
#initialize ⇒ WindowHelper
Returns a new instance of WindowHelper.
6 7 8 |
# File 'lib/watir/WindowHelper.rb', line 6 def initialize() @autoit = Watir.autoit end |
Class Method Details
.check_autoit_installed ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/watir/WindowHelper.rb', line 40 def WindowHelper.check_autoit_installed begin Watir.autoit rescue raise Watir::Exception::WatirException, "The AutoIt dll must be correctly registered for this feature to work properly" end end |
Instance Method Details
#logon(title, name = 'john doe', password = 'john doe') ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/watir/WindowHelper.rb', line 32 def logon(title,name = 'john doe',password = 'john doe') @autoit.WinWait title, "" @autoit.Send name @autoit.Send "{TAB}" @autoit.Send password @autoit.Send "{ENTER}" end |
#push_alert_button ⇒ Object
10 11 12 13 |
# File 'lib/watir/WindowHelper.rb', line 10 def @autoit.WinWait @@ie_window_name, "" @autoit.Send "{ENTER}" end |
#push_confirm_button_cancel ⇒ Object
20 21 22 23 |
# File 'lib/watir/WindowHelper.rb', line 20 def @autoit.WinWait @@ie_window_name, "" @autoit.Send "{ESCAPE}" end |
#push_confirm_button_ok ⇒ Object
15 16 17 18 |
# File 'lib/watir/WindowHelper.rb', line 15 def @autoit.WinWait @@ie_window_name, "" @autoit.Send "{ENTER}" end |
#push_security_alert_yes ⇒ Object
25 26 27 28 29 30 |
# File 'lib/watir/WindowHelper.rb', line 25 def push_security_alert_yes @autoit.WinWait "Security Alert", "" @autoit.Send "{TAB}" @autoit.Send "{TAB}" @autoit.Send "{SPACE}" end |