org.jboss.test.selenium.locator
Class JQueryLocator

java.lang.Object
  extended by org.jboss.test.selenium.locator.AbstractLocator<T>
      extended by org.jboss.test.selenium.locator.AbstractElementLocator<JQueryLocator>
          extended by org.jboss.test.selenium.locator.JQueryLocator
All Implemented Interfaces:
CompoundableLocator<JQueryLocator>, ElementLocator<JQueryLocator>, ExtendedLocator<JQueryLocator>, IterableLocator<JQueryLocator>, Locator<JQueryLocator>

public class JQueryLocator
extends AbstractElementLocator<JQueryLocator>
implements ExtendedLocator<JQueryLocator>

Locates the element using JQuery Selector syntax.

This syntax is extended in AjaxSelenium by new filters similar to :contains(text)

Version:
$Revision$
Author:
Lukas Fryc

Constructor Summary
JQueryLocator(String jquerySelector)
          Instantiates a new jQuery locator.
 
Method Summary
 JQueryLocator format(Object... args)
           
 Iterable<JQueryLocator> getAllChildren()
          Gets the all children of element given by this locator
 Iterable<JQueryLocator> getAllOccurrences()
          Gets the all occurrences of element given by this locator
 JQueryLocator getChild(JQueryLocator elementLocator)
          Gets a child of this locator by composing this locator with given elementLocator.
 Iterable<JQueryLocator> getChildren(JQueryLocator elementLocator)
          Gets the children given by locator composed from this locator and given elementLocator.
 JQueryLocator getDescendant(JQueryLocator elementLocator)
          Gets a descendant of this locator by composing this locator with given elementLocator.
 Iterable<JQueryLocator> getDescendants(JQueryLocator elementLocator)
          Gets all the descendants for this locator specified by composed locator from this locator and given elementLocator.
 ElementLocationStrategy getLocationStrategy()
          Returns the location strategy for this element
 JQueryLocator getNthChildElement(int index)
          Gets the N-th child element of this locator.
 JQueryLocator getNthOccurence(int index)
          Gets the N-th occurence of descendant for this locator's element
 
Methods inherited from class org.jboss.test.selenium.locator.AbstractElementLocator
getAttribute
 
Methods inherited from class org.jboss.test.selenium.locator.AbstractLocator
getAsString, getRawLocator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.test.selenium.locator.ElementLocator
getAttribute
 
Methods inherited from interface org.jboss.test.selenium.locator.Locator
getAsString, getRawLocator
 

Constructor Detail

JQueryLocator

public JQueryLocator(String jquerySelector)
Instantiates a new jQuery locator.

Parameters:
jquerySelector - the jquery selector
Method Detail

getLocationStrategy

public ElementLocationStrategy getLocationStrategy()
Description copied from interface: Locator
Returns the location strategy for this element

Specified by:
getLocationStrategy in interface ElementLocator<JQueryLocator>
Specified by:
getLocationStrategy in interface Locator<JQueryLocator>
Returns:
the location strategy for this element

getNthChildElement

public JQueryLocator getNthChildElement(int index)
Description copied from interface: IterableLocator
Gets the N-th child element of this locator.

Specified by:
getNthChildElement in interface IterableLocator<JQueryLocator>
Parameters:
index - the index of the child subsequent to this locator
Returns:
the N-th child element of this locator

getNthOccurence

public JQueryLocator getNthOccurence(int index)
Description copied from interface: IterableLocator
Gets the N-th occurence of descendant for this locator's element

Specified by:
getNthOccurence in interface IterableLocator<JQueryLocator>
Parameters:
index - the index of the descendant of this locator
Returns:
the N-th occurence of descendant

getAllChildren

public Iterable<JQueryLocator> getAllChildren()
Description copied from interface: IterableLocator
Gets the all children of element given by this locator

Specified by:
getAllChildren in interface IterableLocator<JQueryLocator>
Returns:
the all children of element given by this locator

getAllOccurrences

public Iterable<JQueryLocator> getAllOccurrences()
Description copied from interface: IterableLocator
Gets the all occurrences of element given by this locator

Specified by:
getAllOccurrences in interface IterableLocator<JQueryLocator>
Returns:
the all occurrences of element given by this locator

getChildren

public Iterable<JQueryLocator> getChildren(JQueryLocator elementLocator)
Description copied from interface: IterableLocator
Gets the children given by locator composed from this locator and given elementLocator.

Specified by:
getChildren in interface IterableLocator<JQueryLocator>
Parameters:
elementLocator - the locator for element for composition with this locator
Returns:
the children given by locator composed from this locator and elementLocator

getDescendants

public Iterable<JQueryLocator> getDescendants(JQueryLocator elementLocator)
Description copied from interface: IterableLocator
Gets all the descendants for this locator specified by composed locator from this locator and given elementLocator.

Specified by:
getDescendants in interface IterableLocator<JQueryLocator>
Parameters:
elementLocator - the element locator, which should be added to this locator to specify this element's descendants
Returns:
the descendants of element given by composition of this locator and elementLocator

getChild

public JQueryLocator getChild(JQueryLocator elementLocator)
Description copied from interface: CompoundableLocator
Gets a child of this locator by composing this locator with given elementLocator.

Specified by:
getChild in interface CompoundableLocator<JQueryLocator>
Parameters:
elementLocator - are added to this locator to compose new compount locator
Returns:
the composed locator for this locator with added elementLocator

getDescendant

public JQueryLocator getDescendant(JQueryLocator elementLocator)
Description copied from interface: CompoundableLocator
Gets a descendant of this locator by composing this locator with given elementLocator.

Specified by:
getDescendant in interface CompoundableLocator<JQueryLocator>
Parameters:
elementLocator - are added to this locator to compose new compound locator
Returns:
the composed locator for this locator with added elementLocator

format

public JQueryLocator format(Object... args)
Specified by:
format in interface ElementLocator<JQueryLocator>
Specified by:
format in interface ExtendedLocator<JQueryLocator>
Specified by:
format in interface Locator<JQueryLocator>
Overrides:
format in class AbstractElementLocator<JQueryLocator>


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.