public class JQueryElement extends Object implements org.openqa.selenium.WebElement, GlobalReferenceHolder
| Constructor and Description |
|---|
JQueryElement() |
JQueryElement(JQuery jquery,
org.openqa.selenium.WebDriver webDriver,
List<org.openqa.selenium.WebElement> webElements) |
JQueryElement(JQuery jquery,
org.openqa.selenium.WebDriver webDriver,
String ref) |
JQueryElement(JQuery jquery,
org.openqa.selenium.WebDriver webDriver,
org.openqa.selenium.WebElement webElement) |
| Modifier and Type | Method and Description |
|---|---|
String |
attr(String name)
The .attr() method gets the attribute value for only the first element in
the matched set.
|
void |
clear() |
void |
click() |
String |
css(String propertyName)
method to get css value of specified property of first wrapped element.
|
void |
each(Consumer<JQueryElement> consumer) |
JQueryElement |
find(String selector) |
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by) |
JQueryElement |
first()
Given a jQuery object that represents a set of DOM elements, the
.first() method constructs a new jQuery object from the first
element in that set. |
List<org.openqa.selenium.WebElement> |
get() |
org.openqa.selenium.WebElement |
get(int index) |
String |
getAttribute(String name) |
String |
getCssValue(String propertyName) |
long |
getLength() |
org.openqa.selenium.Point |
getLocation() |
org.openqa.selenium.Rectangle |
getRect() |
String |
getReference() |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
Capture the screenshot of FIRST wrapped element and store it in
the specified location.
|
String |
getSelector() |
org.openqa.selenium.Dimension |
getSize() |
String |
getTagName() |
String |
getText() |
org.openqa.selenium.WebDriver |
getWebDriver() |
boolean |
hasMatches() |
double |
height() |
boolean |
is(String expr)
Check the current matched set of elements against a selector
|
boolean |
isDisplayed() |
boolean |
isEnabled() |
boolean |
isSelected() |
JQueryElement |
last()
Given a jQuery object that represents a set of DOM elements, the
.last() method constructs a new jQuery object from the last
element in that set. |
org.openqa.selenium.Point |
offset() |
JQueryElement |
prev(String selector) |
String |
prop(String name)
The .prop() method gets the property value for only the first element in
the matched set.
|
void |
sendKeys(CharSequence... keysToSend)
This method will use the
val(String)-method to set
the value of a text input. |
void |
submit() |
String |
text()
Get the combined text contents of each element in the set of matched
elements, including their descendants.
|
String |
toString() |
void |
val()
Get the current value of the first element
|
void |
val(String value)
set the value of every matched element.
|
double |
width() |
public JQueryElement()
public JQueryElement(JQuery jquery, org.openqa.selenium.WebDriver webDriver, String ref)
public JQueryElement(JQuery jquery, org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement webElement)
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
throws org.openqa.selenium.WebDriverException
For WebDriver extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference:
For WebElement extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference: - The entire content of the HTML element - The visisble portion of the HTML element
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotX - Return type for getScreenshotAs.target - target type, @see OutputTypeNULL if there are no wrapped elementsorg.openqa.selenium.WebDriverException - on failure.public void click()
click in interface org.openqa.selenium.WebElementpublic void submit()
submit in interface org.openqa.selenium.WebElementpublic long getLength()
public String getSelector()
public void sendKeys(CharSequence... keysToSend)
val(String)-method to set
the value of a text input.sendKeys in interface org.openqa.selenium.WebElementpublic void clear()
clear in interface org.openqa.selenium.WebElementpublic String getTagName()
getTagName in interface org.openqa.selenium.WebElementpublic String getAttribute(String name)
getAttribute in interface org.openqa.selenium.WebElementpublic boolean isSelected()
isSelected in interface org.openqa.selenium.WebElementpublic boolean isEnabled()
isEnabled in interface org.openqa.selenium.WebElementpublic String getText()
getText in interface org.openqa.selenium.WebElementpublic List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebElementpublic org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebElementpublic boolean isDisplayed()
isDisplayed in interface org.openqa.selenium.WebElementpublic org.openqa.selenium.Point getLocation()
getLocation in interface org.openqa.selenium.WebElementpublic org.openqa.selenium.Dimension getSize()
getSize in interface org.openqa.selenium.WebElementpublic org.openqa.selenium.Rectangle getRect()
getRect in interface org.openqa.selenium.WebElementpublic String getCssValue(String propertyName)
getCssValue in interface org.openqa.selenium.WebElementpublic List<org.openqa.selenium.WebElement> get()
public org.openqa.selenium.WebElement get(int index)
public boolean hasMatches()
public boolean is(String expr)
expr - public String prop(String name)
NULL for the value of a property that
has not been set, or if the matched set has no elements.name - NULL if not set or
this jquery object has no dom elements.public String attr(String name)
NULL for the value of a attribute
that has not been set, or if the matched set has no elements.name - NULL if not set
or this jquery object has no dom elements.public String getReference()
getReference in interface GlobalReferenceHolderpublic JQueryElement find(String selector)
public String text()
public String css(String propertyName)
propertyName - NULL if css
property is not set or no wrapped elements are availablepublic void val(String value)
value - new valuepublic void val()
value - new valuepublic double width()
public double height()
public org.openqa.selenium.Point offset()
public void each(Consumer<JQueryElement> consumer)
public JQueryElement prev(String selector)
public JQueryElement last()
.last() method constructs a new jQuery object from the last
element in that set.JQueryElement or
NULL when no matching elements are availablepublic JQueryElement first()
.first() method constructs a new jQuery object from the first
element in that set.JQueryElement or
NULL when no matching elements are availablepublic org.openqa.selenium.WebDriver getWebDriver()
Copyright © 2016. All rights reserved.