com.atlassian.webdriver.utils.by
Class ByJquery
java.lang.Object
org.openqa.selenium.By
com.atlassian.webdriver.utils.by.ByJquery
public abstract class ByJquery
- extends org.openqa.selenium.By
Provides an extension to By so that jQuery selectors can be used. By calling the ByJquery.$
method will ensure that jQuery get's loaded into the page. It is namespaced away within the
javascript so that it doens't override another version of jQuery on the page. This allows the
ByJquery locator to be dependent on it's own version of jQuery.
same usages of ByJquery include: ByJquery.$("div.className li");
ByJQuery.$("('div.className li a').parent('div')"); It accepts simple searches like the
first example that don't need to be wrapped in brackets, but if you want to call another jQuery
method like .parent the first selector needs to be wrapped in brakcets.
- Since:
- 2.0
| Nested classes/interfaces inherited from class org.openqa.selenium.By |
org.openqa.selenium.By.ByClassName, org.openqa.selenium.By.ByCssSelector, org.openqa.selenium.By.ById, org.openqa.selenium.By.ByLinkText, org.openqa.selenium.By.ByName, org.openqa.selenium.By.ByPartialLinkText, org.openqa.selenium.By.ByTagName, org.openqa.selenium.By.ByXPath |
| Methods inherited from class org.openqa.selenium.By |
className, cssSelector, findElements, id, linkText, name, partialLinkText, tagName, toString, xpath |
$
public static ByJquery $(org.openqa.selenium.WebElement element)
$
public static ByJquery $(String selector)
find
public ByJquery find(String selector)
parent
public ByJquery parent()
parent
public ByJquery parent(String selector)
parents
public ByJquery parents()
parents
public ByJquery parents(String selector)
siblings
public ByJquery siblings()
siblings
public ByJquery siblings(String selector)
children
public ByJquery children()
children
public ByJquery children(String selector)
prev
public ByJquery prev()
prev
public ByJquery prev(String selector)
closest
public ByJquery closest(String selector)
filter
public ByJquery filter(String selector)
- This allows filtering results based on a selector or a function.
elements are currently not supported.
- Parameters:
selector - can represent a selector expression or a function
- Returns:
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.SearchContext context)
- Find a single element. Override this method if necessary.
- Overrides:
findElement in class org.openqa.selenium.By
- Parameters:
context - A context to use to find the element
- Returns:
- The WebElement that matches the selector
equals
public boolean equals(Object o)
- Overrides:
equals in class org.openqa.selenium.By
hashCode
public int hashCode()
- Overrides:
hashCode in class org.openqa.selenium.By
Copyright © 2014 Atlassian. All rights reserved.