Locates elements using the locator.

@return NodeElement[]
@throws ElementNotFoundException When element wasn't found on the page.
495687
protected function locateElements()
	{
		$elements = $this->locator->findAll();

		if ( empty($elements) ) {
			throw new ElementNotFoundException('No elements found by selector: ' . (string)$this->locator);
		}

		return $elements;
	}
862729
protected function missingSelectors()
    {
        foreach ($this->extends as $extend) {
            if (isset($extend[3])) {
                continue;
            }

            list($target, $origin, $block) = $extend;

            // ignore if !optional
            if ($block[2]) {
                continue;
            }

            $target = implode(' ', $target);
            $origin = $this->collapseSelectors($origin);

            $this->sourceLine = $block[Parser::SOURCE_LINE];
            $this->throwError("\"$origin\" failed to @extend \"$target\". The selector \"$target\" was not found.");
        }
    }
860236
public function getElements()
    {
        // Get dependencies
        $toolbox = $this->container->toolbox;
        $json = $this->container->json;

        if (isset($this->elementOptions)) {
            return $this->elementOptions;
        }

        // Get all JSON files in directory
        $jsonPath = ROOT_DIR . "structure/definitions/elements/";
        $elements = [];

        foreach ($toolbox->getDirectoryFiles($jsonPath) as $key => $file) {
            if (null === $definition = $json->getJson($jsonPath . $file['filename'], 'element')) {
                throw new Exception('Element JSON definition error: ' . print_r($json->getErrorMessages(), true));
            } else {
                $definition->filename = $file['filename'];
                $elements[] = $definition;
            }
        }

        return $this->elementOptions = $elements;
    }
538146
public function elements(): array
    {
        if (!isset($this->_unspecifiedTypes)) {
            $this->_unspecifiedTypes = array_map(
                function (Element $el) {
                    return new UnspecifiedType($el);
                }, $this->_elements);
        }
        return $this->_unspecifiedTypes;
    }
492737
function findElementSelectors() {
	/* jshint validthis:true */
	var self = this;

	// reset selectors
	this.selectors = [];

	this.testFiles.forEach(function(item) {
		self.selectors = self.selectors.concat(findSelectors.init(item));
	});

	checkSelectorViewMatches.call(this);
}
954961
protected function getSelectors()
	{
		/* @var $annotations FindByAnnotation[] */
		$annotations = $this->property->getAnnotationsFromPropertyOrClass('@find-by');

		$this->assertAnnotationClass($annotations);

		$selectors = array();

		foreach ( $annotations as $annotation ) {
			$selectors[] = $annotation->getSelector();
		}

		return $selectors;
	}
207671
public function getDefaultElements()
    {
        $relations = $this->owner->uninherited('element_defaults');
        if (!$relations) $relations = [];

        // inherit relations from another PageType
        if ($inherit_relations_from = $this->owner->uninherited('element_relations_inherit_from'))
        {
            if ($inherit_relations = Config::inst()->get($inherit_relations_from, 'element_defaults', Config::UNINHERITED))
            {
                $relations = array_merge_recursive($relations, $inherit_relations);
            }
        }
        return $relations;
    }
817808
public function findAll($selector, $locator)
	{
		$items = array();

		foreach ( $this->_nodes as $node ) {
			$items = array_merge($items, $node->findAll($selector, $locator));
		}

		return $items;
	}
946500
private function _getSectionSources(Element $element = null): array
    {
        $sources = [];
        $sections = Craft::$app->getSections()->getAllSections();
        $showSingles = false;

        foreach ($sections as $section) {
            if ($section->type === Section::TYPE_SINGLE) {
                $showSingles = true;
            } else if ($element) {
                // Does the section have URLs in the same site as the element we're editing?
                $sectionSiteSettings = $section->getSiteSettings();
                if (isset($sectionSiteSettings[$element->siteId]) && $sectionSiteSettings[$element->siteId]->hasUrls) {
                    $sources[] = 'section:'.$section->uid;
                }
            }
        }

        if ($showSingles) {
            array_unshift($sources, 'singles');
        }

        return $sources;
    }
181113
public function get_siblings() {
        // Returns a list of the siblings of the current node for display in a flat navigation element. Either
        // the in-page links or the breadcrumb links.
        $siblings = false;

        if ($this->has_siblings()) {
            $siblings = [];
            foreach ($this->parent->children as $child) {
                if ($child->display) {
                    $siblings[] = $child;
                }
            }
        }
        return $siblings;
    }
356507
protected function locateObject()
	{
		if ( $this->locatorUsed ) {
			return;
		}

		// NodeElement + TargetElement = Proxy.
		$this->locatorUsed = true;

		$object = call_user_func(
			array($this->className, 'fromNodeElements'),
			$this->locateElements(),
			null,
			$this->pageFactory
		);

		\ArrayObject::offsetSet(null, $object);
	}
751546
public List<WebElement> getElements() {
        List<WebElement> foundElements = null;
        try {
            if (parent == null) {
                foundElements = HtmlElementUtils.locateElements(getLocator());
            } else {
                foundElements = parent.locateChildElements(getLocator());
            }
        } catch (NoSuchElementException n) {
            addInfoForNoSuchElementException(n);
        }

        return foundElements;
    }
917131
public function getBranchesList() {
    $locations_to_be_displayed = [];
    $db = \Drupal::database();
    if (!empty($this->nodeId) && $node = $this->entityTypeManager->getStorage('node')->load($this->nodeId)) {
      $query = $db->select('node_field_data', 'n');
      // Field on Session that has Class.
      $query->innerJoin('node__field_session_class', 'fc', 'n.nid = fc.entity_id');
      $query->innerJoin('node_field_data', 'fdc', 'fc.field_session_class_target_id = fdc.nid');
      $query->condition('fdc.status', 1);
      // Field on Class that has Activity.
      $query->innerJoin('node__field_class_activity', 'fa', 'fc.field_session_class_target_id = fa.entity_id');
      $query->innerJoin('node_field_data', 'fda', 'fa.field_class_activity_target_id = fda.nid');
      $query->condition('fda.status', 1);
      // Field on Activity that has Programs Subcategory
      $query->innerJoin('node__field_activity_category', 'fps', 'fa.field_class_activity_target_id = fps.entity_id');
      $query->innerJoin('node_field_data', 'fds', 'fa.field_class_activity_target_id = fda.nid');
      // Field on Session that has Location.
      $query->innerJoin('node__field_session_location', 'fl', 'n.nid = fl.entity_id');
      $query->fields('fl', ['field_session_location_target_id']);
      $query->condition('n.type', 'session');
      $query->condition('fps.field_activity_category_target_id', $this->nodeId);
      $query->condition('n.status', 1);
      $query->groupBy('fl.field_session_location_target_id');
      $items = $query->execute()->fetchAll();

      foreach ($items as $item) {
        $locations_to_be_displayed[$item->field_session_location_target_id] = $item->field_session_location_target_id;
      }
    }
    return self::getLocations($locations_to_be_displayed);
    
  }
525228
protected function elements()
    {
        $window = $this->getUrlWindow($this->onEachSide);

        return array_filter(array(
            $window['first'],
            is_array($window['slider']) ? '...' : null,
            $window['slider'],
            is_array($window['last']) ? '...' : null,
            $window['last'],
        ));
    }
93594
public function getNodes()
    {
        $nodes = [];
        foreach ($this->applications as $application) {
            foreach ($application->getNodes() as $node) {
                $nodes[$node->getName()] = $node;
            }
        }

        return $nodes;
    }
993844
@Override
  public List<WebElement> findElements() {
    SlowLoadingElementList list = new SlowLoadingElementList(clock, timeOutInSeconds);
    try {
      return list.get().getElements();
    } catch (NoSuchElementError e) {
      return new ArrayList<>();
    }
  }
214621
public function readElements()
  {
    $iterator = new ArrayIterator;
    do
    {
      $object = $this->readElement();
      if($object) $iterator->append($object);
    } while((boolean)$object);

    $this->objects = $iterator;
    return $this->objects;
  }