All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.codeborne.selenide.impl.SelenideElementIterator Maven / Gradle / Ivy

package com.codeborne.selenide.impl;

import com.codeborne.selenide.SelenideElement;

import java.util.Iterator;

public class SelenideElementIterator implements Iterator {
  protected final WebElementsCollection collection;
  protected int index;

  public SelenideElementIterator(WebElementsCollection collection) {
    this.collection = collection;
  }

  @Override
  public boolean hasNext() {
    return collection.getActualElements().size() > index;
  }

  @Override
  public SelenideElement next() {
    return CollectionElement.wrap(collection, index++);
  }

  @Override
  public void remove() {
    throw new UnsupportedOperationException("Cannot remove elements from web page");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy