Class: AePageObjects::MultipleWindows::Window

Inherits:
SingleWindow::Window show all
Defined in:
lib/ae_page_objects/multiple_windows/window.rb

Instance Attribute Summary collapse

Attributes inherited from SingleWindow::Window

#current_document

Instance Method Summary collapse

Methods inherited from SingleWindow::Window

#change_to

Constructor Details

#initialize(registry, handle) ⇒ Window

Returns a new instance of Window.



6
7
8
9
10
11
12
13
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 6

def initialize(registry, handle)
  @registry = registry
  @handle   = handle

  @registry.add(self)

  super()
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.



4
5
6
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 4

def handle
  @handle
end

Instance Method Details

#closeObject



20
21
22
23
24
25
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 20

def close
  if WindowHandleManager.close(@handle)
    self.current_document = nil
    @registry.remove(self)
  end
end

#switch_toObject



15
16
17
18
# File 'lib/ae_page_objects/multiple_windows/window.rb', line 15

def switch_to
  WindowHandleManager.switch_to(handle)
  current_document
end