public class DOM
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
defaultWaitingTimeout |
| Constructor and Description |
|---|
DOM() |
| Modifier and Type | Method and Description |
|---|---|
static ShouldableWebElement |
$(org.openqa.selenium.By seleniumSelector)
Find the first element matching given CSS selector
|
static ShouldableWebElement |
$(org.openqa.selenium.By seleniumSelector,
int index) |
static ShouldableWebElement |
$(java.lang.String cssSelector)
Find the first element matching given CSS selector
|
static ShouldableWebElement |
$(java.lang.String cssSelector,
int index)
Find the Nth element matching given criteria
|
static ShouldableWebElement |
$(org.openqa.selenium.WebElement parent,
java.lang.String cssSelector)
Find the first element matching given CSS selector
|
static ShouldableWebElement |
$(org.openqa.selenium.WebElement parent,
java.lang.String cssSelector,
int index)
Find the Nth element matching given criteria
|
static ElementsCollection |
$$(org.openqa.selenium.By seleniumSelector)
Find all elements matching given CSS selector.
|
static ElementsCollection |
$$(java.lang.String cssSelector)
Find all elements matching given CSS selector.
|
static ElementsCollection |
$$(org.openqa.selenium.WebElement parent,
java.lang.String cssSelector)
Find all elements matching given CSS selector.
|
static ShouldableWebElement |
assertChecked(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertDisabled(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertElement(org.openqa.selenium.By selector,
Condition condition) |
static ShouldableWebElement |
assertElement(org.openqa.selenium.WebElement element,
Condition condition) |
static ShouldableWebElement |
assertEnabled(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertHidden(org.openqa.selenium.By selector)
Method fails if element does not exists.
|
static ShouldableWebElement |
assertNotChecked(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertNotSelected(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertSelected(org.openqa.selenium.By criteria) |
static ShouldableWebElement |
assertVisible(org.openqa.selenium.By selector) |
static void |
callOnClick(org.openqa.selenium.By by)
Calls onclick javascript code, useful for invisible (hovered) elements that cannot be clicked directly
|
static void |
click(org.openqa.selenium.By by) |
static void |
click(org.openqa.selenium.By by,
int index)
Click the Nth matched element on the page.
|
static void |
confirm(java.lang.String expectedConfirmationText)
Accept (Click "Yes" or "Ok") in the confirmation dialog (javascript 'alert' or 'confirm').
|
static java.lang.String |
describeElement(org.openqa.selenium.WebElement element)
Deprecated.
Use $("selector").toString()
|
static void |
dismiss(java.lang.String expectedConfirmationText)
Dismiss (click "No" or "Cancel") in the confirmation dialog (javascript 'alert' or 'confirm').
|
static java.lang.Object |
executeJavaScript(java.lang.String jsCode) |
static boolean |
existsAndVisible(org.openqa.selenium.By selector) |
static void |
followLink(org.openqa.selenium.By by) |
static ShouldableWebElement |
getElement(org.openqa.selenium.By criteria)
Find the first element matching given criteria
|
static ShouldableWebElement |
getElement(org.openqa.selenium.By criteria,
int index)
Find the Nth element matching given criteria
|
static ElementsCollection |
getElements(org.openqa.selenium.By criteria)
Find all elements matching given CSS selector
|
static ShouldableWebElement |
getSelectedRadio(org.openqa.selenium.By radioField) |
static java.lang.String |
getSelectedText(org.openqa.selenium.By selectField) |
static java.lang.String |
getSelectedValue(org.openqa.selenium.By selectField) |
static boolean |
isJQueryAvailable() |
static boolean |
isVisible(org.openqa.selenium.By selector) |
static <PageObjectClass> |
page(java.lang.Class<PageObjectClass> pageObjectClass)
Create a Page Object instance.
|
static <PageObjectClass,T extends PageObjectClass> |
page(T pageObject)
Create a Page Object instance.
|
static void |
scrollTo(org.openqa.selenium.By element)
It works only if jQuery "scroll" plugin is included in page being tested
|
static org.openqa.selenium.support.ui.Select |
select(org.openqa.selenium.By selectField) |
static void |
selectOption(org.openqa.selenium.By selectField,
java.lang.String value) |
static void |
selectOptionByText(org.openqa.selenium.By selectField,
java.lang.String text) |
static ShouldableWebElement |
selectRadio(org.openqa.selenium.By radioField,
java.lang.String value)
Select radio field by value
|
static void |
setValue(org.openqa.selenium.By by,
int index,
java.lang.String value) |
static void |
setValue(org.openqa.selenium.By by,
java.lang.String value) |
static void |
setValue(org.openqa.selenium.WebElement element,
java.lang.String value) |
static void |
triggerChangeEvent(org.openqa.selenium.By by) |
static void |
triggerChangeEvent(org.openqa.selenium.By by,
int index) |
static ShouldableWebElement |
waitFor(org.openqa.selenium.By elementSelector) |
static ShouldableWebElement |
waitFor(org.openqa.selenium.By elementSelector,
Condition condition)
Deprecated.
|
static ShouldableWebElement |
waitFor(org.openqa.selenium.By elementSelector,
Condition condition,
long timeoutMs)
Deprecated.
|
static ShouldableWebElement |
waitFor(org.openqa.selenium.By elementSelector,
int index,
Condition condition,
long timeoutMs)
Deprecated.
|
static ShouldableWebElement |
waitFor(java.lang.String cssSelector) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.By elementSelector,
Condition condition) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.By elementSelector,
Condition condition,
long timeoutMs) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.By elementSelector,
int index,
Condition condition) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.By elementSelector,
int index,
Condition condition,
long timeoutMs) |
static ShouldableWebElement |
waitUntil(java.lang.String cssSelector,
Condition condition) |
static ShouldableWebElement |
waitUntil(java.lang.String cssSelector,
Condition condition,
long timeoutMs) |
static ShouldableWebElement |
waitUntil(java.lang.String cssSelector,
int index,
Condition condition) |
static ShouldableWebElement |
waitUntil(java.lang.String cssSelector,
int index,
Condition condition,
long timeoutMs) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition) |
static ShouldableWebElement |
waitUntil(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition,
long timeoutMs) |
static void |
waitWhile(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition) |
static void |
waitWhile(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition,
long timeoutMs) |
public static ShouldableWebElement $(java.lang.String cssSelector)
cssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"org.openqa.selenium.NoSuchElementException - if element was no foundpublic static ShouldableWebElement $(org.openqa.selenium.By seleniumSelector)
seleniumSelector - any Selenium selector like By.id(), By.name() etc.org.openqa.selenium.NoSuchElementException - if element was no foundpublic static ShouldableWebElement $(org.openqa.selenium.By seleniumSelector, int index)
getElement(By, int)public static ShouldableWebElement $(org.openqa.selenium.WebElement parent, java.lang.String cssSelector)
parent - the WebElement to search elements incssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"org.openqa.selenium.NoSuchElementException - if element was no foundpublic static ShouldableWebElement $(java.lang.String cssSelector, int index)
cssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"index - 0..Norg.openqa.selenium.NoSuchElementException - if element was no foundpublic static ShouldableWebElement $(org.openqa.selenium.WebElement parent, java.lang.String cssSelector, int index)
parent - the WebElement to search elements incssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"index - 0..Norg.openqa.selenium.NoSuchElementException - if element was no foundpublic static ElementsCollection $$(java.lang.String cssSelector)
cssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"public static ElementsCollection $$(org.openqa.selenium.By seleniumSelector)
seleniumSelector - any Selenium selector like By.id(), By.name() etc.public static ElementsCollection $$(org.openqa.selenium.WebElement parent, java.lang.String cssSelector)
parent - the WebElement to search elements incssSelector - any CSS selector like "input[name='first_name']" or "#messages .new_message"public static ShouldableWebElement getElement(org.openqa.selenium.By criteria)
criteria - instance of By: By.id(), By.className() etc.org.openqa.selenium.NoSuchElementException - if element was no foundpublic static ShouldableWebElement getElement(org.openqa.selenium.By criteria, int index)
criteria - instance of By: By.id(), By.className() etc.index - 0..Norg.openqa.selenium.NoSuchElementException - if element was no foundpublic static ElementsCollection getElements(org.openqa.selenium.By criteria)
criteria - instance of By: By.id(), By.className() etc.public static void setValue(org.openqa.selenium.By by,
java.lang.String value)
public static void setValue(org.openqa.selenium.By by,
int index,
java.lang.String value)
public static void setValue(org.openqa.selenium.WebElement element,
java.lang.String value)
public static boolean isJQueryAvailable()
public static void click(org.openqa.selenium.By by)
public static void callOnClick(org.openqa.selenium.By by)
public static void click(org.openqa.selenium.By by,
int index)
by - selector to match elementindex - 0..Njava.lang.IllegalArgumentException - if index is bigger than number of matched elements.public static void triggerChangeEvent(org.openqa.selenium.By by)
public static void triggerChangeEvent(org.openqa.selenium.By by,
int index)
public static java.lang.Object executeJavaScript(java.lang.String jsCode)
public static void scrollTo(org.openqa.selenium.By element)
element - HTML element to scroll to.public static ShouldableWebElement selectRadio(org.openqa.selenium.By radioField, java.lang.String value)
radioField - any By selector for finding radio fieldvalue - value to select (should match an attribute "value")public static ShouldableWebElement getSelectedRadio(org.openqa.selenium.By radioField)
public static java.lang.String getSelectedValue(org.openqa.selenium.By selectField)
public static java.lang.String getSelectedText(org.openqa.selenium.By selectField)
public static org.openqa.selenium.support.ui.Select select(org.openqa.selenium.By selectField)
public static void selectOption(org.openqa.selenium.By selectField,
java.lang.String value)
public static void selectOptionByText(org.openqa.selenium.By selectField,
java.lang.String text)
public static boolean existsAndVisible(org.openqa.selenium.By selector)
public static void followLink(org.openqa.selenium.By by)
public static ShouldableWebElement assertChecked(org.openqa.selenium.By criteria)
public static ShouldableWebElement assertNotChecked(org.openqa.selenium.By criteria)
public static ShouldableWebElement assertDisabled(org.openqa.selenium.By criteria)
public static ShouldableWebElement assertEnabled(org.openqa.selenium.By criteria)
public static ShouldableWebElement assertSelected(org.openqa.selenium.By criteria)
public static ShouldableWebElement assertNotSelected(org.openqa.selenium.By criteria)
public static boolean isVisible(org.openqa.selenium.By selector)
public static ShouldableWebElement assertVisible(org.openqa.selenium.By selector)
public static ShouldableWebElement assertHidden(org.openqa.selenium.By selector)
public static ShouldableWebElement assertElement(org.openqa.selenium.By selector, Condition condition)
public static ShouldableWebElement assertElement(org.openqa.selenium.WebElement element, Condition condition)
public static ShouldableWebElement waitFor(org.openqa.selenium.By elementSelector)
public static ShouldableWebElement waitFor(java.lang.String cssSelector)
@Deprecated public static ShouldableWebElement waitFor(org.openqa.selenium.By elementSelector, Condition condition)
public static ShouldableWebElement waitUntil(org.openqa.selenium.By elementSelector, Condition condition)
public static ShouldableWebElement waitUntil(java.lang.String cssSelector, Condition condition)
public static ShouldableWebElement waitUntil(org.openqa.selenium.By elementSelector, int index, Condition condition)
public static ShouldableWebElement waitUntil(java.lang.String cssSelector, int index, Condition condition)
@Deprecated public static ShouldableWebElement waitFor(org.openqa.selenium.By elementSelector, Condition condition, long timeoutMs)
public static ShouldableWebElement waitUntil(org.openqa.selenium.By elementSelector, Condition condition, long timeoutMs)
public static ShouldableWebElement waitUntil(java.lang.String cssSelector, Condition condition, long timeoutMs)
@Deprecated public static ShouldableWebElement waitFor(org.openqa.selenium.By elementSelector, int index, Condition condition, long timeoutMs)
public static ShouldableWebElement waitUntil(java.lang.String cssSelector, int index, Condition condition, long timeoutMs)
public static ShouldableWebElement waitUntil(org.openqa.selenium.By elementSelector, int index, Condition condition, long timeoutMs)
public static ShouldableWebElement waitUntil(org.openqa.selenium.WebElement parent, org.openqa.selenium.By elementSelector, int index, Condition condition)
public static ShouldableWebElement waitUntil(org.openqa.selenium.WebElement parent, org.openqa.selenium.By elementSelector, int index, Condition condition, long timeoutMs)
public static void waitWhile(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition)
public static void waitWhile(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By elementSelector,
int index,
Condition condition,
long timeoutMs)
public static void confirm(java.lang.String expectedConfirmationText)
expectedConfirmationText - if not null, check that confirmation dialog displays this message (case-sensitive)java.lang.AssertionError - if confirmation message differs from expected messagepublic static void dismiss(java.lang.String expectedConfirmationText)
expectedConfirmationText - if not null, check that confirmation dialog displays this message (case-sensitive)java.lang.AssertionError - if confirmation message differs from expected message@Deprecated public static java.lang.String describeElement(org.openqa.selenium.WebElement element)
public static <PageObjectClass> PageObjectClass page(java.lang.Class<PageObjectClass> pageObjectClass)
PageFactory.initElements(org.openqa.selenium.WebDriver, java.lang.Class)public static <PageObjectClass,T extends PageObjectClass> PageObjectClass page(T pageObject)
PageFactory.initElements(org.openqa.selenium.WebDriver, java.lang.Class)