Class: OperaWatir::QuickWindow
- Includes:
- DesktopContainer
- Defined in:
- lib/operawatir/quickwidgets/quick_window.rb
Instance Method Summary collapse
-
#active? ⇒ Boolean
True if window is active.
-
#exist? ⇒ Boolean
(also: #exists?)
Checks whether a window exists or not.
-
#height ⇒ Object
Height of window.
-
#name ⇒ String
Gets the name of the window.
-
#on_screen? ⇒ bool
True if window is on screen.
-
#quick_widgets ⇒ Object
TODO: common with widget.
-
#title ⇒ String
Gets the title of the window.
-
#to_s ⇒ String
Gets a string representation of the window.
-
#type ⇒ Symbol
Gets the type of a window.
-
#width ⇒ Object
Width of window.
-
#window_id ⇒ int
(also: #id)
Gets this windows window id.
-
#window_info_string ⇒ Object
Returns a string of the internal information about the window.
Methods included from DesktopContainer
#quick_addressfield, #quick_button, #quick_checkbox, #quick_dialogtab, #quick_dropdown, #quick_dropdownitem, #quick_editfield, #quick_find, #quick_griditem, #quick_gridlayout, #quick_label, #quick_menu, #quick_menuitem, #quick_radiobutton, #quick_searchfield, #quick_tab, #quick_thumbnail, #quick_toolbar, #quick_treeitem, #quick_treeview, #quick_window
Instance Method Details
#active? ⇒ Boolean
Returns true if window is active.
34 35 36 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 34 def active? element.isActive() end |
#exist? ⇒ Boolean Also known as: exists?
Checks whether a window exists or not
23 24 25 26 27 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 23 def exist? !!element rescue Exceptions::UnknownObjectException false end |
#height ⇒ Object
Returns height of window.
130 131 132 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 130 def height element.getRect().height end |
#name ⇒ String
Gets the name of the window
57 58 59 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 57 def name element.getName end |
#on_screen? ⇒ bool
Returns true if window is on screen.
90 91 92 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 90 def on_screen? element.isOnScreen end |
#quick_widgets ⇒ Object
You can also retrieve only widgets of a given type, using for example
browser.quick_window(:name, "Document Window").
TODO: common with widget
179 180 181 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 179 def (window_id) end |
#title ⇒ String
Gets the title of the window
68 69 70 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 68 def title element.getTitle end |
#to_s ⇒ String
Gets a string representation of the window
80 81 82 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 80 def to_s "#{type} #{name}, title=#{title}, id=#{id}, on_screen=#{on_screen?}, active=#{active?}" end |
#type ⇒ Symbol
Gets the type of a window
45 46 47 48 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 45 def type return WINDOW_ENUM_MAP.invert[@elm.getType] unless @elm == nil return WINDOW_ENUM_MAP.invert[element.getType] end |
#width ⇒ Object
Returns width of window.
122 123 124 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 122 def width element.getRect().width end |
#window_id ⇒ int Also known as: id
Gets this windows window id
101 102 103 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 101 def window_id element.getWindowID end |
#window_info_string ⇒ Object
Returns a string of the internal information about the window. Used to discover the names of widgets and windows to use in the tests.
150 151 152 153 154 155 156 157 158 159 |
# File 'lib/operawatir/quickwidgets/quick_window.rb', line 150 def window_info_string " Name: " + name + "\n Title: " + title + "\n Active: " + active?.to_s + "\n ID: " + id.to_s + "\n Type: " + type.to_s + "\nOnScreen: " + on_screen?.to_s + "\n Pos: x=" + element.getRect().x.to_s + ", y=" + element.getRect().y.to_s + "\n Size: width=" + element.getRect().width.to_s + ", height=" + element.getRect().height.to_s + "\n" end |