public abstract class Fluent extends Object implements SearchActions
| Constructor and Description |
|---|
Fluent() |
Fluent(org.openqa.selenium.WebDriver driver) |
| Modifier and Type | Method and Description |
|---|---|
FluentList<FluentWebElement> |
$(Filter... filters)
Central methods to find elements on the page with filters.
|
FluentWebElement |
$(Integer number,
Filter... filters)
Central method to find an element on the page with filters.
|
FluentList<FluentWebElement> |
$(String name,
Filter... filters)
Central methods to find elements on the page.
|
FluentWebElement |
$(String name,
Integer number,
Filter... filters)
Central methods a find element on the page, the number indicate the index of the desired element on the list.
|
Alert |
alert() |
FluentWait |
await()
wait for an asynchronous call
|
void |
cleanupDriver() |
Fluent |
clear(Filter... filters)
Clear texts of the all elements filtered by the specified filters.
|
Fluent |
clear(FluentList<FluentWebElement> fluentObject)
Clear all elements that are in the list
Be careful - only the visible elements are cleared
|
Fluent |
clear(FluentWebElement fluentObject)
Clear the given parameters elements that are in the list
Be careful - only the visible elements are cleared
|
Fluent |
clear(String cssSelector,
Filter... filters)
Submit all elements that are in cssSelector with its filters
Be careful - only the visible elements are cleared
|
Fluent |
click(Filter... filters)
Click all elements filtered by the specified filters.
|
Fluent |
click(FluentDefaultActions fluentObject)
click all elements that are in the list
Be careful - only the visible elements are clicked
|
Fluent |
click(String cssSelector,
Filter... filters)
click all elements that are in cssSelector with its filters
Be careful - only the visible elements are clicked
|
protected <T extends FluentPage> |
constructPageWithParams(Class<T> cls,
Object[] params) |
<T extends FluentPage> |
createPage(Class<T> classOfPage,
Object... params) |
FluentJavascript |
executeAsyncScript(String script,
Object... args) |
FluentJavascript |
executeScript(String script,
Object... args) |
FillConstructor |
fill(Filter... filters)
Construct a FillConstructor with filters in order to allow easy fill.
|
FillConstructor |
fill(FluentDefaultActions list,
Filter... filters)
Construct a FillConstructor in order to allow easy fill
Be careful - only the visible elements are filled
|
FillConstructor |
fill(String cssSelector,
Filter... filters)
Construct a FillConstructor in order to allow easy fill
Be careful - only the visible elements are filled
|
FillSelectConstructor |
fillSelect(Filter... filters)
Construct a FillSelectConstructor with filters in order to allow easy fill.
|
FillSelectConstructor |
fillSelect(String cssSelector,
Filter... filters)
Construct a FillSelectConstructor in order to allow easy fill
Be careful - only the visible elements are filled
|
FluentList<FluentWebElement> |
find(Filter... filters)
Return the list filtered by the specified filters.
|
FluentWebElement |
find(Integer number,
Filter... filters)
Return the element at the number position in the list filtered by the specified filters.
|
FluentList<FluentWebElement> |
find(String name,
Filter... filters)
return the lists corresponding to the cssSelector with it filters
|
FluentWebElement |
find(String name,
Integer number,
Filter... filters)
Return the elements at the number position into the lists corresponding to the cssSelector with it filters
|
FluentWebElement |
findFirst(Filter... filters)
Return the first element corresponding to the filters.
|
FluentWebElement |
findFirst(String name,
Filter... filters)
Return the first element corresponding to the name and the filters
|
String |
getBaseUrl()
Get the base URL to use when visiting relative URLs, if one is configured
|
org.openqa.selenium.Cookie |
getCookie(String name)
return the corresponding cookie given a name
|
Set<org.openqa.selenium.Cookie> |
getCookies()
return the cookies as a set
|
org.openqa.selenium.WebDriver |
getDriver() |
Search |
getSearch() |
<P extends FluentPage> |
goTo(P page) |
Fluent |
goTo(String url)
Open the url page
|
protected <T extends FluentPage> |
initClass(Class<T> cls,
Object... params) |
protected Fluent |
initFluent(org.openqa.selenium.WebDriver driver) |
protected void |
initTest() |
Fluent |
maximizeWindow()
Maximize browser window using webdriver
|
String |
pageSource()
Return the source of the page
|
void |
quit() |
Fluent |
submit(Filter... filters)
Submit all elements filtered by the specified filters.
|
Fluent |
submit(FluentDefaultActions fluentObject)
Submit all elements that are in the list
Be careful - only the visible elements are submitted
|
Fluent |
submit(String cssSelector,
Filter... filters)
Submit all elements that are in cssSelector with its filters
Be careful - only the visible elements are submitted
|
Fluent |
switchTo()
Switch to the default element
|
Fluent |
switchTo(FluentWebElement element)
Switch to the selected Element (if element is null or not an iframe, or haven't an id then
switch to the default)
|
Fluent |
switchToDefault()
Switch to the default element
|
Fluent |
takeScreenShot()
Take a snapshot of the browser.
|
Fluent |
takeScreenShot(String fileName)
Take a snapshot of the browser into a file given by the fileName param.
|
List<String> |
text(Filter... filters)
Get all texts of the elements filtered by the specified filters.
|
List<String> |
text(String cssSelector,
Filter... filters)
get a list all elements that are in cssSelector with its filters
Be careful - only the visible elements are submitted
//TODO UTILITY ?
|
String |
title()
Return the title of the page
|
String |
url()
Return the url of the page.
|
List<String> |
value(Filter... filters)
Get all values of the elements filtered by the specified filters.
|
List<String> |
value(String cssSelector,
Filter... filters)
Value all elements that are in cssSelector with its filters
Be careful - only the visible elements are returned
//TODO UTILITY ?
|
Fluent |
withDefaultPageWait(long l,
TimeUnit timeUnit)
Define an implicit time to wait for a page to be loaded
|
Fluent |
withDefaultSearchWait(long l,
TimeUnit timeUnit)
Define an implicit time to wait when searching an element
|
Fluent |
withDefaultUrl(String baseUrl)
Define the default url that will be used in the test and in the relative pages
|
public Fluent(org.openqa.selenium.WebDriver driver)
public Fluent()
public Fluent withDefaultUrl(String baseUrl)
baseUrl - base URLpublic Fluent withDefaultPageWait(long l, TimeUnit timeUnit)
l - timeout valuetimeUnit - time unit for waitpublic Fluent withDefaultSearchWait(long l, TimeUnit timeUnit)
l - timeout valuetimeUnit - time unit for waitpublic Fluent takeScreenShot()
public Fluent takeScreenShot(String fileName)
fileName - file name for screenshotprotected Fluent initFluent(org.openqa.selenium.WebDriver driver)
public org.openqa.selenium.WebDriver getDriver()
public Search getSearch()
protected void initTest()
public <T extends FluentPage> T createPage(Class<T> classOfPage, Object... params)
protected <T extends FluentPage> T initClass(Class<T> cls, Object... params)
protected <T extends FluentPage> T constructPageWithParams(Class<T> cls, Object[] params) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
public String getBaseUrl()
public FluentWait await()
public String title()
public Set<org.openqa.selenium.Cookie> getCookies()
public org.openqa.selenium.Cookie getCookie(String name)
name - cookie namepublic String url()
public String pageSource()
public <P extends FluentPage> P goTo(P page)
public Fluent goTo(String url)
url - page URL to visitpublic FluentJavascript executeScript(String script, Object... args)
public FluentJavascript executeAsyncScript(String script, Object... args)
public FluentList<FluentWebElement> $(String name, Filter... filters)
name - item selectorfilters - set of filterspublic FluentList<FluentWebElement> $(Filter... filters)
filters - set of filters in the current contextpublic FluentWebElement $(String name, Integer number, Filter... filters)
name - item selectornumber - index of the desired elementfilters - set of filters in the current contextpublic FluentWebElement $(Integer number, Filter... filters)
number - index of element from obtained listfilters - set of filters in the current contextpublic FluentList<FluentWebElement> find(String name, Filter... filters)
find in interface SearchActionsname - cssSelectorfilters - set of filters in current contextpublic FluentList<FluentWebElement> find(Filter... filters)
find in interface SearchActionsfilters - set of filters in the current contextpublic FluentWebElement find(String name, Integer number, Filter... filters)
find in interface SearchActionsname - cssSelectornumber - index in the retrieved items listfilters - set of filters in the current contextpublic FluentWebElement find(Integer number, Filter... filters)
find in interface SearchActionsnumber - index in the retrieved items listfilters - set of filters in the current contextpublic FluentWebElement findFirst(String name, Filter... filters)
findFirst in interface SearchActionsname - cssSelectorfilters - set of filters in the current contextpublic FluentWebElement findFirst(Filter... filters)
findFirst in interface SearchActionsfilters - set of filters in the current contextpublic FillConstructor fill(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic FillConstructor fill(Filter... filters)
filters - set of filters in the current contextpublic FillConstructor fill(FluentDefaultActions list, Filter... filters)
list - FluentDefaultActions listfilters - set of filters in the current contextpublic FillSelectConstructor fillSelect(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic FillSelectConstructor fillSelect(Filter... filters)
filters - set of filters in the current contextpublic Fluent click(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic Fluent click(Filter... filters)
filters - set of filters in the current contextpublic Fluent clear(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic Fluent clear(Filter... filters)
filters - set of filters in the current contextpublic Fluent submit(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic Fluent submit(Filter... filters)
filters - set of filters in the current contextpublic List<String> text(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic List<String> text(Filter... filters)
filters - set of filters in the current contextpublic List<String> value(String cssSelector, Filter... filters)
cssSelector - cssSelectorfilters - set of filters in the current contextpublic List<String> value(Filter... filters)
filters - set of filters in the current contextpublic Fluent click(FluentDefaultActions fluentObject)
fluentObject - fluent object to clickpublic Fluent clear(FluentList<FluentWebElement> fluentObject)
fluentObject - list of fluent web elements to clearpublic Fluent clear(FluentWebElement fluentObject)
fluentObject - fluent web element to clearpublic Fluent submit(FluentDefaultActions fluentObject)
fluentObject - fluent default actionspublic Fluent switchTo(FluentWebElement element)
element - fluent web elementpublic Fluent switchTo()
public Fluent switchToDefault()
public Alert alert()
public Fluent maximizeWindow()
public void quit()
public void cleanupDriver()
Copyright © 2015 AConsulting. All Rights Reserved.