public abstract class AbstractHtmlEngine extends AbstractEngine implements IHtmlEngine
elementsFactory, uiDriver| Constructor and Description |
|---|
AbstractHtmlEngine(UiDriver uiDriver,
AbstractElementsFactory elementsFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
clickBrowserBackButton()
Move back a single "item" in the browser's history.
|
void |
clickBrowserForwardButton()
Move a single "item" forward in the browser's history.
|
void |
clickBrowserRefreshButton()
Refresh the current page.
|
void |
closeActiveWindow()
Close the active window/tab
|
int |
countElements(String xpath)
Returns the number of HTML elements that match the specified xpath
eg. |
int |
countElementsByCssSelector(String cssSelector)
Returns the number of HTML elements that match the specified css selector
eg. |
void |
deleteAllCookies()
Delete all the cookies for the current domain
|
void |
deleteCookieNamed(String cookieName)
Delete the named cookie from the current domain.
This is equivalent to setting the named cookie's expiration date to some time in the past. |
String |
executeJavaScript(String javaScriptCommand)
Gets the result of evaluating the specified JavaScript command.
|
void |
fireEvent(UiElement element,
String eventName)
Explicitly simulate an event, to trigger the corresponding "onevent" handler.
|
Cookie[] |
getCookies()
Get all the cookies for the current domain.
|
String |
getCurrentUrl() |
String |
getPageSource()
Get page source as String
|
String[] |
getWindowTitles()
Returns the titles of all windows that the browser knows about
|
void |
goToFirstWindowWithoutTitle()
Go to first window/tab without title, skipping the main window
|
void |
goToMainWindow()
Go to main window/tab
|
void |
goToPage(String url)
Navigate to another URL from within the same already started browser
|
void |
goToWindow(String windowTitle)
Going to window/tab with given title
|
void |
goToWindow(String windowTitle,
long timeoutInSeconds)
Going to window/tab with given title
|
void |
reloadFrames() |
void |
retrieveBrowserFocus()
Retrieve the browser's focus.
|
void |
setCookie(String cookieName,
String cookieValue) |
void |
setCookie(String name,
String value,
String domain,
String path,
Date expiry,
boolean isSecure) |
getMapSection, loadMapFile, setMapSectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexpectAlert, expectConfirm, expectPrompt, getButton, getButton, getCheckBox, getCheckBox, getElement, getElement, getFileBrowse, getFileBrowse, getLink, getLink, getMultiSelectList, getMultiSelectList, getRadioList, getRadioList, getSingleSelectList, getSingleSelectList, getTable, getTable, getTextArea, getTextArea, getTextBox, getTextBox, getUtilsElementStatepublic AbstractHtmlEngine(UiDriver uiDriver, AbstractElementsFactory elementsFactory)
public void goToPage(String url)
url - of the page to gopublic String getCurrentUrl()
public String getPageSource()
public String[] getWindowTitles()
public void goToWindow(String windowTitle)
windowTitle - window title or name (the value of "window.name" defined when the window was opened)public void goToWindow(String windowTitle, long timeoutInSeconds)
windowTitle - window title or name (the value of "window.name" defined when the window was opened)timeoutInSeconds - timeout (in seconds) for waiting the target window to appearpublic void goToMainWindow()
public void goToFirstWindowWithoutTitle()
public void closeActiveWindow()
public void fireEvent(UiElement element, String eventName)
element - the target elementeventName - the name of the event to fire e.g. click, blur, focus, keydown, keyup, keypress...public void reloadFrames()
public void retrieveBrowserFocus()
public String executeJavaScript(String javaScriptCommand)
Gets the result of evaluating the specified JavaScript command. The command/snippet may have multiple lines, but only the result of the last line will be returned.
Note that, by default, the command will run in the context of the "selenium" object itself, so this will refer to the Selenium object.
Use window to refer to the window of your application, e.g. var fooEl = window.document.getElementById('foo'); fooEl.name;
javaScriptCommand - the JavaScript commandpublic int countElements(String xpath)
xpath - the xpath expression to evaluatepublic int countElementsByCssSelector(String cssSelector)
cssSelector - the css selector expression to evaluatepublic void setCookie(String cookieName, String cookieValue)
cookieName - the name of the cookie. May not be null or an empty string.cookieValue - the cookie value. May not be null.public void setCookie(String name, String value, String domain, String path, Date expiry, boolean isSecure)
name - the name of the cookie. May not be null or an empty string.value - the cookie value. May not be null.domain - the domain the cookie is visible to.path - the path the cookie is visible to. If left blank or set to null, will be set to
"/".expiry - the cookie's expiration date; may be null.isSecure - whether this cookie requires a secure connection.public Cookie[] getCookies()
Cookies arraypublic void deleteCookieNamed(String cookieName)
cookieName - the name of the cookie. May not be null or an empty string.public void deleteAllCookies()
public void clickBrowserBackButton()
public void clickBrowserForwardButton()
public void clickBrowserRefreshButton()
Copyright © 2017 Axway Software. All rights reserved.