Class: AutomationObject::State::Element

Inherits:
Base show all
Includes:
CommonElement
Defined in:
lib/automation_object/state/element.rb

Overview

Element composite for managing state

Instance Attribute Summary

Attributes included from CommonElement

#active, #cache

Attributes inherited from Base

#blue_prints, #driver

Attributes inherited from Composite

#children, #location, #name, #parent

Instance Method Summary collapse

Methods included from CommonElement

#active?, #method_hook?, #method_hooks, #method_to_container, #reset

Methods inherited from Base

#get_child, #get_children, #initialize, #screen, #top

Methods inherited from Composite

#add_has_many_relationships, #add_has_one_relationships, #get_child, #get_children, has_many, has_many_relationships, has_one, has_one_relationships, #initialize, #top

Methods included from Reflection

#add_alias, #add_attribute

Methods included from CompositeHook

#after_create_run, #before_create_run, included

Constructor Details

This class inherits a constructor from AutomationObject::State::Base

Instance Method Details

#utilizeAutomationObject::State::ElementProxy

Returns Selenium proxy

Returns:



15
16
17
18
19
20
21
# File 'lib/automation_object/state/element.rb', line 15

def utilize
  return cache if cache

  element = driver.find_element(*blue_prints.selector_params)
  @active = true
  self.cache = ElementProxy.new(self, element)
end