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

org.openqa.selenium.remote.server.handler.WebElementHandler Maven / Gradle / Ivy

Go to download

Selenium automates browsers. That's it! What you do with that power is entirely up to you.

There is a newer version: 3.9.1
Show newest version
package org.openqa.selenium.remote.server.handler;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.server.Session;

public abstract class WebElementHandler extends ResponseAwareWebDriverHandler {
  private volatile String elementId;

  protected WebElementHandler(Session session) {
    super(session);
  }

  public void setId(String elementId) {
    this.elementId = elementId;
  }

  protected WebElement getElement() {
    return getKnownElements().get(elementId);
  }

  protected String getElementAsString() {
    try {
      return elementId + " " + String.valueOf(getElement());
    } catch (RuntimeException e) {
      // Be paranoid!
    }

    return elementId + " unknown";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy