Class: Mohawk::Adapters::UIA::Window
- Inherits:
-
Object
- Object
- Mohawk::Adapters::UIA::Window
- Includes:
- Waiter
- Defined in:
- lib/mohawk/adapters/uia/window.rb
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
Instance Method Summary collapse
- #activate ⇒ Object
- #active? ⇒ Boolean
- #exist? ⇒ Boolean
- #handle ⇒ Object
-
#initialize(locator, container) ⇒ Window
constructor
A new instance of Window.
- #present? ⇒ Boolean
- #send_keys(*keys) ⇒ Object
- #text ⇒ Object
- #title ⇒ Object
- #wait_until_present(context = nil) ⇒ Object
Methods included from Waiter
Constructor Details
#initialize(locator, container) ⇒ Window
Returns a new instance of Window.
11 12 13 14 |
# File 'lib/mohawk/adapters/uia/window.rb', line 11 def initialize(locator, container) @locator = locator @container = container end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
9 10 11 |
# File 'lib/mohawk/adapters/uia/window.rb', line 9 def element @element end |
Instance Method Details
#activate ⇒ Object
29 30 31 32 |
# File 'lib/mohawk/adapters/uia/window.rb', line 29 def activate Mohawk::Win32.set_foreground_window handle Mohawk::Win32.activate handle end |
#active? ⇒ Boolean
25 26 27 |
# File 'lib/mohawk/adapters/uia/window.rb', line 25 def active? Mohawk::Win32.foreground_window == handle end |
#exist? ⇒ Boolean
34 35 36 |
# File 'lib/mohawk/adapters/uia/window.rb', line 34 def exist? Mohawk::Win32.is_window handle end |
#handle ⇒ Object
38 39 40 |
# File 'lib/mohawk/adapters/uia/window.rb', line 38 def handle (locate_element && element.handle) || 0 end |
#present? ⇒ Boolean
50 51 52 |
# File 'lib/mohawk/adapters/uia/window.rb', line 50 def present? locate_element != nil end |
#send_keys(*keys) ⇒ Object
20 21 22 23 |
# File 'lib/mohawk/adapters/uia/window.rb', line 20 def send_keys(*keys) activate element.send_keys keys end |
#text ⇒ Object
46 47 48 |
# File 'lib/mohawk/adapters/uia/window.rb', line 46 def text element.descendants.map &:name end |
#title ⇒ Object
42 43 44 |
# File 'lib/mohawk/adapters/uia/window.rb', line 42 def title element.name end |