Module: Watir::HasWindow
- Included in:
- Browser
- Defined in:
- lib/watir-webdriver/has_window.rb
Instance Method Summary collapse
-
#window(*args, &blk) ⇒ Window
Returns browser window.
-
#windows(*args) ⇒ Array<Window>
Returns browser windows array.
Instance Method Details
#window(*args, &blk) ⇒ Window
Returns browser window.
34 35 36 37 38 39 40 |
# File 'lib/watir-webdriver/has_window.rb', line 34 def window(*args, &blk) win = Window.new @driver, extract_selector(args) win.use(&blk) if block_given? win end |
#windows(*args) ⇒ Array<Window>
Returns browser windows array.
14 15 16 17 18 19 20 21 22 |
# File 'lib/watir-webdriver/has_window.rb', line 14 def windows(*args) all = @driver.window_handles.map { |handle| Window.new(@driver, :handle => handle) } if args.empty? all else filter_windows extract_selector(args), all end end |