public class Selenide
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
defaultWaitingTimeout |
static Navigator |
navigator |
| Constructor and Description |
|---|
Selenide() |
| 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 webElement)
Wrap standard Selenium WebElement into ShouldableWebElement to use additional methods like shouldHave(), selectOption() etc.
|
protected static ShouldableWebElement |
$(org.openqa.selenium.WebElement parent,
org.openqa.selenium.By selector,
int index) |
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,
org.openqa.selenium.By seleniumSelector)
Find all elements matching given criteria inside given parent element
|
static ElementsCollection |
$$(org.openqa.selenium.WebElement parent,
java.lang.String cssSelector)
Find all elements matching given CSS selector inside given parent element
Methods returns an ElementsCollection which is a list of WebElement objects that can be iterated,
and at the same time is implementation of WebElement interface, meaning that you can call methods .sendKeys(), click() etc.
|
static void |
confirm(java.lang.String expectedConfirmationText)
Accept (Click "Yes" or "Ok") in the confirmation dialog (javascript 'alert' or 'confirm').
|
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 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 org.openqa.selenium.WebElement |
getFocusedElement() |
static ShouldableWebElement |
getSelectedRadio(org.openqa.selenium.By radioField) |
static void |
open(java.lang.String relativeOrAbsoluteUrl) |
static void |
open(java.net.URL absoluteUrl) |
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 |
refresh()
Reload current page
|
static ShouldableWebElement |
selectRadio(org.openqa.selenium.By radioField,
java.lang.String value)
Select radio field by value
|
static void |
sleep(long milliseconds)
Not recommended.
|
static org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
static java.lang.String |
title() |
public static long defaultWaitingTimeout
public static Navigator navigator
public static void open(java.lang.String relativeOrAbsoluteUrl)
public static void open(java.net.URL absoluteUrl)
public static void refresh()
public static java.lang.String title()
public static void sleep(long milliseconds)
milliseconds - Time to sleep in millisecondspublic static ShouldableWebElement $(org.openqa.selenium.WebElement webElement)
webElement - standard Selenium WebElementpublic 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)
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 foundprotected static ShouldableWebElement $(org.openqa.selenium.WebElement parent, org.openqa.selenium.By selector, int index)
public 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 ElementsCollection $$(org.openqa.selenium.WebElement parent, org.openqa.selenium.By seleniumSelector)
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 java.lang.Object executeJavaScript(java.lang.String jsCode)
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 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 messagepublic static org.openqa.selenium.WebDriver.TargetLocator switchTo()
public static org.openqa.selenium.WebElement getFocusedElement()
public static <PageObjectClass> PageObjectClass page(java.lang.Class<PageObjectClass> pageObjectClass)
PageFactory.initElements(org.openqa.selenium.WebDriver, Class)public static <PageObjectClass,T extends PageObjectClass> PageObjectClass page(T pageObject)
PageFactory.initElements(org.openqa.selenium.WebDriver, Class)