Class: FileUploadElement

Inherits:
MechanizeElement show all
Defined in:
lib/web_minion/bots/elements/file_upload_element.rb

Instance Attribute Summary

Attributes inherited from MechanizeElement

#bot, #element, #target, #target_type, #value

Instance Method Summary collapse

Constructor Details

#initialize(bot, target, value, element) ⇒ FileUploadElement

Returns a new instance of FileUploadElement.



4
5
6
# File 'lib/web_minion/bots/elements/file_upload_element.rb', line 4

def initialize(bot, target, value, element)
  super(bot, target, value, element)
end

Instance Method Details

#set_fileObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/web_minion/bots/elements/file_upload_element.rb', line 8

def set_file
  case @target_type
  when :index
    index_set
  when :string_path
    string_set
  when :first_last
    first_last_set
  else
    raise(InvalidTargetType, "#{@target_type} is not valid!")
  end
end