Class: TestSteps::Handlers::ListAllDropdownValues

Inherits:
Base
  • Object
show all
Defined in:
lib/functions/handlers/list_all_dropdowns_values.rb

Overview

List all Dropdown Values function.

Instance Method Summary collapse

Methods inherited from Base

#login_button, #login_check, #login_process, #mem_word_check, #open_url_process, perform, #portal_mem_word, register

Instance Method Details

#perform(step_attributes) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/functions/handlers/list_all_dropdowns_values.rb', line 11

def perform(step_attributes)
  dropdown = step_attributes[:testvalue]
  locate = step_attributes[:locate]

  Browser.b.element("#{locate}": dropdown).wait_until(&:exists?)
  Browser.b.select_list("#{locate}": dropdown).options.each do |i|
    MyLog.log.info("List of dropdown for #{dropdown} are: #{i.text}")
    return true
  end
rescue StandardError
  MyLog.log.warn("List dropdown: #{dropdown} does not exist")
  false
end