com.atlassian.jira.webtest.framework.core.locator
Interface Element


public interface Element

Represents an element (existing or not-existing) on a page in given test context. May be used to query existence and some properties of an arbitrary element on a tested page.

Elements are bound to and may be retrieved via Locators.

Since:
v4.3
See Also:
Locator

Method Summary
 TimedQuery<String> attribute(String attrName)
          TimedQuery for the element's given attribute (if any).
 Element clear()
          If this element is an input, this will clear out it's value.
 Element click()
          Click this element
 TimedCondition containsText(String text)
          A condition representing a query of this element in terms of it containing a particular text.
 TimedCondition doesNotContainText(String text)
          A condition representing a query of this element in terms of it NOT containing a particular text.
 TimedCondition isNotPresent()
          A condition representing non-existence of this locator on a page.
 TimedCondition isNotVisible()
          A condition representing non-visibility of this locator on a page.
 TimedCondition isPresent()
          A condition representing existence of this locator on a page.
 TimedCondition isVisible()
          A condition representing visibility of this locator on a page.
 TimedQuery<String> text()
          TimedQuery for the element's text (if any).
 Element type(com.atlassian.webtest.ui.keys.KeySequence keys)
          Type given key sequence into the element
 TimedQuery<String> value()
          TimedQuery for the element's value.
 

Method Detail

isPresent

TimedCondition isPresent()
A condition representing existence of this locator on a page.

Returns:
timed condition representing existence of this element

isNotPresent

TimedCondition isNotPresent()
A condition representing non-existence of this locator on a page.

Returns:
timed condition representing non-existence of this element

isVisible

TimedCondition isVisible()
A condition representing visibility of this locator on a page.

Returns:
timed condition representing visibility of this element

isNotVisible

TimedCondition isNotVisible()
A condition representing non-visibility of this locator on a page.

Returns:
timed condition representing non-visibility of this element

containsText

TimedCondition containsText(String text)
A condition representing a query of this element in terms of it containing a particular text.

Parameters:
text - text to check against
Returns:
timed condition representing a query of text contents of this element

doesNotContainText

TimedCondition doesNotContainText(String text)
A condition representing a query of this element in terms of it NOT containing a particular text.

Parameters:
text - text to check against
Returns:
timed condition representing a query of text contents of this element

value

TimedQuery<String> value()
TimedQuery for the element's value. This element must be present before this query returns (and within the query's timeout).

Returns:
timed query for this element's value, null if this element is not present or has no value and the timeout expires.

text

TimedQuery<String> text()
TimedQuery for the element's text (if any). This element must be present before this query returns (and within the query's timeout).

Returns:
timed query for this element's text. null if this element is not present or has no text and the timeout expires.

attribute

TimedQuery<String> attribute(String attrName)
TimedQuery for the element's given attribute (if any). This element must be present before this query returns (within the query's timeout).

Parameters:
attrName - name of the attribute
Returns:
timed query for this element's attribute. null if this element is not present or has no such attribute and the timeout expires.

type

Element type(com.atlassian.webtest.ui.keys.KeySequence keys)
Type given key sequence into the element

Parameters:
keys - key sequence to type in
Returns:
this element instance
Throws:
IllegalStateException - if the element does not allow, or support typing (e.g. is not present on the page).

clear

Element clear()
If this element is an input, this will clear out it's value. Otherwise it will not have any effect.

Returns:
this element

click

Element click()
Click this element

Returns:
this element instance
Throws:
IllegalStateException - if the element does not allow, or support clicking (e.g. is not present on the page).


Copyright © 2002-2013 Atlassian. All Rights Reserved.