public class

CssLocator

extends AbstractLocator
implements Locator
java.lang.Object
   ↳ com.atlassian.jira.functest.framework.locator.AbstractLocator
     ↳ com.atlassian.jira.functest.framework.locator.CssLocator

Class Overview

A CSS locator that uses JSOUP for the supported CSS selectors

At present it is a subset of jQuery CSS support so be a bit careful with the more tricky selectors

Summary

[Expand]
Inherited Fields
From class com.atlassian.jira.functest.framework.locator.AbstractLocator
Public Constructors
CssLocator(WebTester tester, String cssSelector)
Locates org.w3c.dom.Node's using the specified net.sourceforge.jwebunit.WebTester
CssLocator(Node startNode, String cssSelector)
Locates org.w3c.dom.Node's starting from the specified org.w3c.dom.Node

The start node can ONLY be a node given out previous by another CssLocator.

Public Methods
Node[] getNodes()
A Locator may return 0 nodes, 1 node or multiple nodes.
String toString()
Protected Methods
Node betterNode(Node node)
[Expand]
Inherited Methods
From class com.atlassian.jira.functest.framework.locator.AbstractLocator
From class java.lang.Object
From interface com.atlassian.jira.functest.framework.locator.Locator

Public Constructors

public CssLocator (WebTester tester, String cssSelector)

Locates org.w3c.dom.Node's using the specified net.sourceforge.jwebunit.WebTester

Parameters
tester the WebTester in play
cssSelector the CSS selector string

public CssLocator (Node startNode, String cssSelector)

Locates org.w3c.dom.Node's starting from the specified org.w3c.dom.Node

The start node can ONLY be a node given out previous by another CssLocator. It will throw and IllegalArgumentException if you give it any other type of Node.

Parameters
startNode the org.w3c.dom.Node to start at.
cssSelector the CSS selector string

Public Methods

public Node[] getNodes ()

A Locator may return 0 nodes, 1 node or multiple nodes.

Returns
  • a non null array of Nodes that match, or a zero sized array of no matches are made

public String toString ()

Protected Methods

protected Node betterNode (Node node)