| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
ElementFinder.findElement(WebDriver driver,
String locator) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
JavascriptLibrary.callEmbeddedHtmlUtils(WebDriver driver,
String functionName,
WebElement element,
Object... values) |
void |
JavascriptLibrary.callEmbeddedSelenium(WebDriver driver,
String functionName,
WebElement element,
Object... values) |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
SeleniumSelect.findOption(String optionLocator) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
SeleniumSelect.getAllOptions() |
List<WebElement> |
SeleniumSelect.getSelectedOptions() |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
WebDriver.TargetLocator.activeElement()
Switches to the element that currently has focus within the document currently "switched to",
or the body element if this cannot be detected.
|
WebElement |
WebElement.findElement(By by)
Find the first
WebElement using the given method. |
WebElement |
WebDriver.findElement(By by)
Find the first
WebElement using the given method. |
WebElement |
SearchContext.findElement(By by)
Find the first
WebElement using the given method. |
WebElement |
By.findElement(SearchContext context)
Find a single element.
|
WebElement |
By.ById.findElement(SearchContext context) |
WebElement |
By.ByLinkText.findElement(SearchContext context) |
WebElement |
By.ByPartialLinkText.findElement(SearchContext context) |
WebElement |
By.ByName.findElement(SearchContext context) |
WebElement |
By.ByTagName.findElement(SearchContext context) |
WebElement |
By.ByXPath.findElement(SearchContext context) |
WebElement |
By.ByClassName.findElement(SearchContext context) |
WebElement |
By.ByCssSelector.findElement(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
WebElement.findElements(By by)
Find all elements within the current context using the given mechanism.
|
List<WebElement> |
WebDriver.findElements(By by)
Find all elements within the current page using the given mechanism.
|
List<WebElement> |
SearchContext.findElements(By by)
Find all elements within the current context using the given mechanism.
|
abstract List<WebElement> |
By.findElements(SearchContext context)
Find many elements.
|
List<WebElement> |
By.ById.findElements(SearchContext context) |
List<WebElement> |
By.ByLinkText.findElements(SearchContext context) |
List<WebElement> |
By.ByPartialLinkText.findElements(SearchContext context) |
List<WebElement> |
By.ByName.findElements(SearchContext context) |
List<WebElement> |
By.ByTagName.findElements(SearchContext context) |
List<WebElement> |
By.ByXPath.findElements(SearchContext context) |
List<WebElement> |
By.ByClassName.findElements(SearchContext context) |
List<WebElement> |
By.ByCssSelector.findElements(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
WebDriver |
WebDriver.TargetLocator.frame(WebElement frameElement)
Select a frame using its previously located
WebElement. |
| 限定符和类型 | 方法和说明 |
|---|---|
Actions |
Actions.click(WebElement onElement)
Clicks in the middle of the given element.
|
Actions |
Actions.clickAndHold(WebElement onElement)
Clicks (without releasing) in the middle of the given element.
|
Actions |
Actions.contextClick(WebElement onElement)
Performs a context-click at middle of the given element.
|
Actions |
Actions.doubleClick(WebElement onElement)
Performs a double-click at middle of the given element.
|
Actions |
Actions.dragAndDrop(WebElement source,
WebElement target)
A convenience method that performs click-and-hold at the location of the source element,
moves to the location of the target element, then releases the mouse.
|
Actions |
Actions.dragAndDropBy(WebElement source,
int xOffset,
int yOffset)
A convenience method that performs click-and-hold at the location of the source element,
moves by a given offset, then releases the mouse.
|
Actions |
Actions.keyDown(WebElement element,
Keys theKey)
Performs a modifier key press after focusing on an element.
|
Actions |
Actions.keyUp(WebElement element,
Keys theKey)
Performs a modifier key release after focusing on an element.
|
Actions |
Actions.moveToElement(WebElement toElement)
Moves the mouse to the middle of the element.
|
Actions |
Actions.moveToElement(WebElement toElement,
int xOffset,
int yOffset)
Moves the mouse to an offset from the top-left corner of the element.
|
Actions |
Actions.release(WebElement onElement)
Releases the depressed left mouse button, in the middle of the given element.
|
Actions |
Actions.sendKeys(WebElement element,
CharSequence... keysToSend)
Equivalent to calling:
Actions.click(element).sendKeys(keysToSend).
|
| 限定符和类型 | 方法和说明 |
|---|---|
TouchActions |
TouchActions.doubleTap(WebElement onElement)
Allows the execution of double tapon the screen, analogous to double click using a Mouse.
|
TouchActions |
TouchActions.flick(WebElement onElement,
int xOffset,
int yOffset,
int speed)
Allows the execution of flick gestures starting in a location's element.
|
TouchActions |
TouchActions.longPress(WebElement onElement)
Allows the execution of long press gestures.
|
TouchActions |
TouchActions.scroll(WebElement onElement,
int xOffset,
int yOffset)
Creates a scroll gesture that starts on a particular screen location.
|
TouchActions |
TouchActions.singleTap(WebElement onElement)
Allows the execution of single tap on the screen, analogous to click using a Mouse.
|
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
FindsByClassName.findElementByClassName(String using) |
WebElement |
FindsByCssSelector.findElementByCssSelector(String using) |
WebElement |
FindsById.findElementById(String using) |
WebElement |
FindsByLinkText.findElementByLinkText(String using) |
WebElement |
FindsByName.findElementByName(String using) |
WebElement |
FindsByLinkText.findElementByPartialLinkText(String using) |
WebElement |
FindsByTagName.findElementByTagName(String using) |
WebElement |
FindsByXPath.findElementByXPath(String using) |
WebElement |
WrapsElement.getWrappedElement() |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
FindsByClassName.findElementsByClassName(String using) |
List<WebElement> |
FindsByCssSelector.findElementsByCssSelector(String using) |
List<WebElement> |
FindsById.findElementsById(String using) |
List<WebElement> |
FindsByLinkText.findElementsByLinkText(String using) |
List<WebElement> |
FindsByName.findElementsByName(String using) |
List<WebElement> |
FindsByLinkText.findElementsByPartialLinkText(String using) |
List<WebElement> |
FindsByTagName.findElementsByTagName(String using) |
List<WebElement> |
FindsByXPath.findElementsByXPath(String using) |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.hamcrest.Matcher<WebElement> |
Matchers.attribute(String attributeName,
org.hamcrest.Matcher<String> valueMatcher) |
static org.hamcrest.Matcher<WebElement> |
Matchers.displayed() |
static Finder<WebElement,WebDriver> |
Finders.first(Finder<WebElement,WebDriver> finder)
A finder which returns the first element matched - such as if you have multiple elements which
match the finder (such as multiple links with the same text on a page etc)
|
static org.hamcrest.Matcher<WebElement> |
Matchers.selection() |
static org.hamcrest.Matcher<WebElement> |
Matchers.text(org.hamcrest.Matcher<String> textMatcher) |
static org.hamcrest.Matcher<WebElement> |
Matchers.value(Object value) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
WebDriverTestContext.assertPresenceOf(Finder<WebElement,WebDriver> finder) |
void |
TestContext.assertPresenceOf(Finder<WebElement,WebDriver> finder) |
void |
WebDriverTestContext.assertPresenceOf(org.hamcrest.Matcher<Integer> cardinalityConstraint,
Finder<WebElement,WebDriver> finder) |
void |
TestContext.assertPresenceOf(org.hamcrest.Matcher<Integer> cardinalityConstraint,
Finder<WebElement,WebDriver> finder) |
void |
WebDriverTestContext.clickOn(Finder<WebElement,WebDriver> finder) |
void |
TestContext.clickOn(Finder<WebElement,WebDriver> finder) |
void |
WebDriverTestContext.clickOnFirst(Finder<WebElement,WebDriver> finder) |
static Finder<WebElement,WebDriver> |
Finders.first(Finder<WebElement,WebDriver> finder)
A finder which returns the first element matched - such as if you have multiple elements which
match the finder (such as multiple links with the same text on a page etc)
|
void |
WebDriverTestContext.type(String input,
Finder<WebElement,WebDriver> finder) |
void |
TestContext.type(String input,
Finder<WebElement,WebDriver> finder) |
void |
WebDriverTestContext.waitFor(Finder<WebElement,WebDriver> finder,
long timeoutMillis) |
void |
TestContext.waitFor(Finder<WebElement,WebDriver> finder,
long timeout) |
| 限定符和类型 | 方法和说明 |
|---|---|
HtmlTagFinder |
HtmlTagFinder.with(org.hamcrest.Matcher<WebElement> matcher) |
| 限定符和类型 | 方法和说明 |
|---|---|
static org.hamcrest.Matcher<WebElement> |
AttributeMatcher.attribute(String name,
org.hamcrest.Matcher<String> valueMatcher) |
static org.hamcrest.Matcher<WebElement> |
DisplayedMatcher.displayed() |
static org.hamcrest.Matcher<WebElement> |
SelectionMatcher.selection() |
static org.hamcrest.Matcher<WebElement> |
TextMatcher.text(org.hamcrest.Matcher<String> textMatcher) |
static org.hamcrest.Matcher<WebElement> |
ValueMatcher.value(Object value) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
ValueMatcher.matchesSafely(WebElement item) |
boolean |
TextMatcher.matchesSafely(WebElement item) |
boolean |
SelectionMatcher.matchesSafely(WebElement item) |
boolean |
DisplayedMatcher.matchesSafely(WebElement item) |
boolean |
AttributeMatcher.matchesSafely(WebElement item) |
| 限定符和类型 | 类和说明 |
|---|---|
class |
RemoteWebElement |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
ByIdOrName.findElement(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
ByIdOrName.findElements(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
EventFiringWebDriver.findElement(By by) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
EventFiringWebDriver.findElements(By by) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
WebDriverEventListener.afterChangeValueOf(WebElement element,
WebDriver driver,
CharSequence[] keysToSend)
Called after
WebElement.clear(), WebElement.sendKeys(...)}. |
void |
AbstractWebDriverEventListener.afterChangeValueOf(WebElement element,
WebDriver driver,
CharSequence[] keysToSend) |
void |
WebDriverEventListener.afterClickOn(WebElement element,
WebDriver driver)
Called after
WebElement.click(). |
void |
AbstractWebDriverEventListener.afterClickOn(WebElement element,
WebDriver driver) |
void |
WebDriverEventListener.afterFindBy(By by,
WebElement element,
WebDriver driver)
Called after
WebDriver.findElement(...), or
WebDriver.findElements(...), or WebElement.findElement(...), or WebElement.findElements(...). |
void |
AbstractWebDriverEventListener.afterFindBy(By by,
WebElement element,
WebDriver driver) |
void |
WebDriverEventListener.beforeChangeValueOf(WebElement element,
WebDriver driver,
CharSequence[] keysToSend)
Called before
WebElement.clear(), WebElement.sendKeys(...). |
void |
AbstractWebDriverEventListener.beforeChangeValueOf(WebElement element,
WebDriver driver,
CharSequence[] keysToSend) |
void |
WebDriverEventListener.beforeClickOn(WebElement element,
WebDriver driver)
Called before
WebElement.click(). |
void |
AbstractWebDriverEventListener.beforeClickOn(WebElement element,
WebDriver driver) |
void |
WebDriverEventListener.beforeFindBy(By by,
WebElement element,
WebDriver driver)
Called before
WebDriver.findElement(...), or
WebDriver.findElements(...), or WebElement.findElement(...), or WebElement.findElements(...). |
void |
AbstractWebDriverEventListener.beforeFindBy(By by,
WebElement element,
WebDriver driver) |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
ElementLocator.findElement() |
WebElement |
DefaultElementLocator.findElement()
Find the element.
|
WebElement |
AjaxElementLocator.findElement()
Find the element.
|
WebElement |
ByChained.findElement(SearchContext context) |
WebElement |
ByAll.findElement(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<WebElement> |
ElementLocator.findElements() |
List<WebElement> |
DefaultElementLocator.findElements()
Find the element list.
|
List<WebElement> |
AjaxElementLocator.findElements()
Find the element list.
|
List<WebElement> |
ByChained.findElements(SearchContext context) |
List<WebElement> |
ByAll.findElements(SearchContext context) |
| 限定符和类型 | 方法和说明 |
|---|---|
WebElement |
Select.getFirstSelectedOption() |
WebElement |
ISelect.getFirstSelectedOption() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ExpectedCondition<WebElement> |
ExpectedConditions.elementToBeClickable(By locator)
An expectation for checking an element is visible and enabled such that you can click it.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.elementToBeClickable(WebElement element)
An expectation for checking an element is visible and enabled such that you can click it.
|
List<WebElement> |
Select.getAllSelectedOptions() |
List<WebElement> |
ISelect.getAllSelectedOptions() |
List<WebElement> |
Select.getOptions() |
List<WebElement> |
ISelect.getOptions() |
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.numberOfElementsToBe(By locator,
Integer number)
An expectation for checking number of WebElements with given locator
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.numberOfElementsToBeLessThan(By locator,
Integer number)
An expectation for checking number of WebElements with given locator being less than defined
number
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.numberOfElementsToBeMoreThan(By locator,
Integer number)
An expectation for checking number of WebElements with given locator
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.presenceOfAllElementsLocatedBy(By locator)
An expectation for checking that there is at least one element present on a web page.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.presenceOfElementLocated(By locator)
An expectation for checking that an element is present on the DOM of a page.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.presenceOfNestedElementLocatedBy(By locator,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to present
|
static ExpectedCondition<WebElement> |
ExpectedConditions.presenceOfNestedElementLocatedBy(WebElement element,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to be present
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.presenceOfNestedElementsLocatedBy(By locator,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to present
|
static ExpectedCondition<WebElement> |
ExpectedConditions.visibilityOf(WebElement element)
An expectation for checking that an element, known to be present on the DOM of a page, is
visible.
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfAllElements(List<WebElement> elements)
An expectation for checking that all elements present on the web page that match the locator
are visible.
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfAllElementsLocatedBy(By locator)
An expectation for checking that all elements present on the web page that match the locator
are visible.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.visibilityOfElementLocated(By locator)
An expectation for checking that an element is present on the DOM of a page and visible.
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfNestedElementsLocatedBy(By locator,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to be visible
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfNestedElementsLocatedBy(WebElement element,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to be visible
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ExpectedCondition<Boolean> |
ExpectedConditions.attributeContains(WebElement element,
String attribute,
String value)
An expectation for checking WebElement with given locator has attribute which contains specific
value
|
static ExpectedCondition<Boolean> |
ExpectedConditions.attributeToBe(WebElement element,
String attribute,
String value)
An expectation for checking given WebElement has attribute with a specific value
|
static ExpectedCondition<Boolean> |
ExpectedConditions.attributeToBeNotEmpty(WebElement element,
String attribute)
An expectation for checking WebElement any non empty value for given attribute
|
static ExpectedCondition<Boolean> |
ExpectedConditions.elementSelectionStateToBe(WebElement element,
boolean selected)
An expectation for checking if the given element is selected.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.elementToBeClickable(WebElement element)
An expectation for checking an element is visible and enabled such that you can click it.
|
static ExpectedCondition<Boolean> |
ExpectedConditions.elementToBeSelected(WebElement element)
An expectation for checking if the given element is selected.
|
static ExpectedCondition<WebDriver> |
ExpectedConditions.frameToBeAvailableAndSwitchToIt(WebElement frameLocator)
An expectation for checking whether the given frame is available to switch to.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.presenceOfNestedElementLocatedBy(WebElement element,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to be present
|
static ExpectedCondition<Boolean> |
ExpectedConditions.stalenessOf(WebElement element)
Wait until an element is no longer attached to the DOM.
|
static ExpectedCondition<Boolean> |
ExpectedConditions.textToBePresentInElement(WebElement element,
String text)
An expectation for checking if the given text is present in the specified element.
|
static ExpectedCondition<Boolean> |
ExpectedConditions.textToBePresentInElementValue(WebElement element,
String text)
An expectation for checking if the given text is present in the specified elements value
attribute.
|
static ExpectedCondition<WebElement> |
ExpectedConditions.visibilityOf(WebElement element)
An expectation for checking that an element, known to be present on the DOM of a page, is
visible.
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfNestedElementsLocatedBy(WebElement element,
By sub_locator)
An expectation for checking child WebElement as a part of parent element to be visible
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ExpectedCondition<Boolean> |
ExpectedConditions.invisibilityOfAllElements(List<WebElement> elements)
An expectation for checking all elements from given list to be invisible
|
static ExpectedCondition<List<WebElement>> |
ExpectedConditions.visibilityOfAllElements(List<WebElement> elements)
An expectation for checking that all elements present on the web page that match the locator
are visible.
|
| 构造器和说明 |
|---|
Select(WebElement element)
Constructor.
|