Class: Taf::TestSteps::Handlers::CaptureAlert

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

Overview

Capture Alert 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
# File 'lib/taf/test_steps/handlers/base/capture_alert.rb', line 10

def perform
  Taf::Browser.b.find_element(class: 'alert').displayed?
  alertmsg = Taf::Browser.b.find_element(class: 'alert').text
  Taf::MyLog.log.info("Alert shown: #{alertmsg}")
  true
rescue StandardError
  Taf::MyLog.log.warn('No Alert Found')
  false
end