com.atlassian.pageobjects.elements
Annotation Type ElementBy


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface ElementBy

Injects an Element into the field. Only one of the selector types should be specified.


Optional Element Summary
 String className
           
 String cssSelector
           
 String id
           
 String linkText
           
 String name
           
 Class<? extends PageElement> pageElementClass
          

Type of the PageElement to inject.

 String partialLinkText
           
 String tagName
           
 TimeoutType timeoutType
          Timeout type associated with the injected page element.
 String within
          The name of the instance variable in the same page object class (or superclass) that is also annotated with @ElementBy and is a parent context of the page element annotated with this annotation (i.e.
 String xpath
           
 

id

public abstract String id
Default:
""

className

public abstract String className
Default:
""

linkText

public abstract String linkText
Default:
""

partialLinkText

public abstract String partialLinkText
Default:
""

cssSelector

public abstract String cssSelector
Default:
""

name

public abstract String name
Default:
""

xpath

public abstract String xpath
Default:
""

tagName

public abstract String tagName
Default:
""

timeoutType

public abstract TimeoutType timeoutType
Timeout type associated with the injected page element.

Returns:
timeout of the injected page element
See Also:
TimeoutType
Default:
com.atlassian.pageobjects.elements.timeout.TimeoutType.DEFAULT

pageElementClass

public abstract Class<? extends PageElement> pageElementClass

Type of the PageElement to inject. Used with Iterator Defaults to the class of the annotated field.

This is not a selector, so you still need to specify a selector.

This attribute doesn't make sense for injecting PageElements fields, but it would still work. It makes sense for erased types: @ElementBy(name="checkbox1", pageElementClass=CheckboxElement.class) private Iterable<CheckboxElement> checkbox1;

Returns:
target class of the page element
Since:
2.1
Default:
com.atlassian.pageobjects.elements.PageElement.class

within

public abstract String within
The name of the instance variable in the same page object class (or superclass) that is also annotated with @ElementBy and is a parent context of the page element annotated with this annotation (i.e. this element on the page is a descendant of the parent element). That parent page element will be used to find this page element withing its scope.

Returns:
parent of page element represented by this annotation
Since:
2.1
Default:
""


Copyright © 2014 Atlassian. All rights reserved.