JSDoc: Class: Store

# Class: Store

## element.Store()

Stores known/seen elements and their associated web element references.

Elements are added by calling |add(el)| or |addAll(elements)|, and may be queried by their web element reference using |get(element)|.

## Constructor

#### new Store()

Source:
  - element.js, line 74

### Methods

#### add(el) → {string}

Make an element seen.

##### Parameters:

Name | Type | Description
--- | --- | ---
`el` | Element | Element to add to set of seen elements.

Source:
  - element.js, line 111

##### Returns:

Web element reference associated with element.

Type
  string

#### addAll(els) → {Array.<WebElement>}

Make a collection of elements seen.

The oder of the returned web element references is guaranteed to match that of the collection passed in.

##### Parameters:

Name | Type | Description
--- | --- | ---
`els` | NodeList | Sequence of elements to add to set of seen elements.

Source:
  - element.js, line 97

##### Returns:

List of the web element references associated with each element from |els|.

Type
  Array.<WebElement>

#### get(uuid) → {Element}

Retrieve a DOM element by its unique web element reference/UUID.

##### Parameters:

Name | Type | Description
--- | --- | ---
`uuid` | string | Web element reference, or UUID.

Source:
  - element.js, line 165

##### Throws:

- If the web element reference uuid has not been seen before.

  Type
    NoSuchElementError

- If the element has gone stale, indicating it is no longer attached to the DOM, or its node document is no longer the active document.

  Type
    StaleElementReferenceError

##### Returns:

Element associated with reference.

Type
  Element

#### has(uuid) → {boolean}

Determine if the provided web element reference has been seen before/is in the element store.

##### Parameters:

Name | Type | Description
--- | --- | ---
`uuid` | string | Element's associated web element reference.

Source:
  - element.js, line 144

##### Returns:

True if element is in the store, false otherwise.

Type
  boolean