Class: Watir::Dialog

Inherits:
Object
  • Object
show all
Defined in:
lib/watir/dialog.rb

Constant Summary collapse

WindowName =
'Windows Internet Explorer'

Instance Method Summary collapse

Instance Method Details

#button(name) ⇒ Object



8
9
10
# File 'lib/watir/dialog.rb', line 8

def button(name)
  DialogButton.new(name)
end

#closeObject



11
12
13
14
15
# File 'lib/watir/dialog.rb', line 11

def close
  # TODO: register autoit before use
  autoit = WIN32OLE.new('AutoItX3.Control')
  autoit.WinClose WindowName, ""
end

#exists?Boolean

Returns:

  • (Boolean)


16
17
18
19
20
21
# File 'lib/watir/dialog.rb', line 16

def exists?
  # TODO: register autoit before use
  autoit = WIN32OLE.new('AutoItX3.Control')
  found = autoit.WinWait(WindowName, "", 1)
  return found == 1
end