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

ru.yandex.qatools.htmlelements.element.Link Maven / Gradle / Ivy

package ru.yandex.qatools.htmlelements.element;

import org.openqa.selenium.WebElement;

/**
 * Represents hyperlink.
 *
 * @author Alexander Tolmachev [email protected]
 */
public class Link extends TypifiedElement {
    public Link(WebElement wrappedElement) {
        super(wrappedElement);
    }

    /**
     * Retrieves reference from "href" attribute.
     *
     * @return Reference associated with hyperlink.
     */
    public String getReference() {
        return getWrappedElement().getAttribute("href");
    }

    /**
     * Clicks the link.
     */
    public void click() {
        getWrappedElement().click();
    }

    /**
     * Returns text of the link.
     */
    public String getText() {
        return getWrappedElement().getText();
    }
}









© 2015 - 2025 Weber Informatics LLC | Privacy Policy