Class: Taf::TestSteps::Handlers::HandleBrowserWindow

Inherits:
Base
  • Object
show all
Defined in:
lib/taf/test_steps/handlers/base/handle_browser_window.rb

Overview

Handle Browser Window function.

Instance Method Summary collapse

Methods inherited from Base

#initialize, #login_check, #login_process, perform, register, #url_check

Constructor Details

This class inherits a constructor from Taf::TestSteps::Handlers::Base

Instance Method Details

#performObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/taf/test_steps/handlers/base/handle_browser_window.rb', line 10

def perform
  Taf::Browser.b.window_handles.each do |handle|
    Taf::Browser.b.switch_to.window handle
    sleep 3
    Taf::Browser.b.title.eql?(@value.to_s)
    Taf::MyLog.log.info("Window title: #{@value} is correct")
    true
  rescue StandardError
    Taf::MyLog.log.warn("Window not found: #{@value}")
    false
  end
end