org.openqa.selenium.internal.HasIdentity Java Examples

The following examples show how to use org.openqa.selenium.internal.HasIdentity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FrameAwareWebElementTransformer.java    From teasy with MIT License 5 votes vote down vote up
@Override
public WebElement apply(final WebElement element) {
    return (WebElement) newProxyInstance(
            getClass().getClassLoader(),
            new Class[]{WebElement.class, WrapsElement.class, Locatable.class, HasIdentity.class},
            invocationHandlerFor(element)
    );
}
 
Example #2
Source File: MorelandWebElement.java    From xframium-java with GNU General Public License v3.0 5 votes vote down vote up
@Override
public String getId()
{
    if ( webElement instanceof HasIdentity )
        return ( (HasIdentity) webElement ).getId();
    else
        return null;
}
 
Example #3
Source File: ElementOption.java    From java-client with Apache License 2.0 5 votes vote down vote up
/**
 * This method sets the element as an option. It means that x/y offset is the offset
 * from the upper left corner of the given element.
 *
 * @param element is the element to calculate offset from.
 * @return self-reference
 */
public ElementOption withElement(WebElement element) {
    checkNotNull(element);
    checkArgument(true, "Element should be an instance of the class which "
            + "implements org.openqa.selenium.internal.HasIdentity",
        element instanceof HasIdentity);
    elementId = ((HasIdentity) element).getId();
    return this;
}