Class: Selenium::AutoIt
- Inherits:
-
Object
- Object
- Selenium::AutoIt
- Defined in:
- lib/buildmaster/win32/auto_it_driver.rb
Constant Summary collapse
- @@autoit =
nil
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ AutoIt
constructor
A new instance of AutoIt.
- #on_window_active(title, text = nil) {|@@autoit| ... } ⇒ Object
Constructor Details
#initialize ⇒ AutoIt
Returns a new instance of AutoIt.
36 37 38 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 36 def initialize @autoit = AutoIt.load end |
Class Method Details
.dll ⇒ Object
32 33 34 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 32 def self.dll File.join(File.dirname(__FILE__), 'autoit', 'AutoItX3.dll') end |
.load ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 5 def self.load begin @@autoit = load_instance rescue WIN32OLERuntimeError registerAutoItDll @@autoit = load_instance end @@autoit end |
.load_instance ⇒ Object
15 16 17 18 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 15 def self.load_instance @@autoit = WIN32OLE.new('AutoItX3.Control') unless @@autoit @@autoit end |
.registerAutoItDll ⇒ Object
28 29 30 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 28 def self.registerAutoItDll system("regsvr32.exe /s #{dll}") end |
.reset ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 20 def self.reset if @@autoit @@autoit.ole_free @@autoit =nil system("regsvr32.exe /s /u #{dll}") end end |
Instance Method Details
#on_window_active(title, text = nil) {|@@autoit| ... } ⇒ Object
40 41 42 43 |
# File 'lib/buildmaster/win32/auto_it_driver.rb', line 40 def on_window_active(title, text = nil) @autoit.WinWaitActive(title, text, 30) yield @@autoit end |