public class DefaultExtWebDriver extends Object implements ExtWebDriver, HighlightProvider
ExtWebDriver.StaleWindowIdListExceptionorg.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window| Constructor and Description |
|---|
DefaultExtWebDriver()
Constructor for ExtWebDriver
|
| Modifier and Type | Method and Description |
|---|---|
void |
back()
Simulates browser Back button
|
void |
cancelNativeDialog()
Clicks cancel on the open confirmation dialog attached to the current
window
|
void |
close() |
void |
closeCurrentBrowser()
Closes the browser window, but does not kill IEDriverServer.exe, use this
if you changed browsers mid-session and want to close the window.
|
void |
confirmNativeDialog()
Clicks ok on the open alert dialog OR confirmation dialog attached to the
current window
|
void |
currentWindowMaximize()
Maximizes the browser window
|
void |
eval(String javaScript)
Executes JavaScript
|
String |
evaluateXpath(String xpath)
Evaluates an XPath in JavaScript to return a string value based on the
resulting node(s) or XPath function results
|
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By arg0) |
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By arg0) |
void |
focus()
Request focus for the active window with the current WebDriver
|
void |
forward()
Simulates browser Forward button
|
void |
get(String arg0) |
String[] |
getAllWindowIds()
Retrieves the windowHandle IDs
|
String |
getBrowserName()
Retrieves the name of the browser currently being operated by the
webdriver
|
String |
getBrowserVersion()
Retrieves the version of the browser currently being operated by the
webdriver
|
String |
getCurrentUrl() |
Map<String,String> |
getGeneratedHtmlSource()
Retrieves current state of the DOM in HTML format for each of the
document's frames.
|
String |
getHighlightColor(String highlightMode)
Get the highlight color based on mode
|
String |
getHtmlSource()
Returns the original HTML source of the current frame
|
long |
getMaxRequestTimeout()
Gets the timeout used by default when waiting on actions
|
String |
getNativeDialogText()
Retrieves the text of the open native dialog attached to the current
window
|
String |
getPageSource() |
String |
getSessionId()
Gets the id of the current session
|
String |
getTitle() |
String |
getWindowHandle() |
Set<String> |
getWindowHandles() |
String |
getWindowId()
Returns the current window handle ID
|
org.openqa.selenium.WebDriver |
getWrappedDriver()
Gets the underlying WebDriver instance
|
int |
getXpathCount(String string)
Returns the count of nodes that would be returned by an XPath expression
|
boolean |
isFocusOnClick()
Indicates the current setting for setting window focus as part of a click
action
|
boolean |
isHighlight() |
boolean |
isJavascriptClickMode()
Indicates the current setting for clicking on interactive elements
|
boolean |
isJavascriptTypeMode()
Indicates the current setting for entry of text in input fields
|
org.openqa.selenium.WebDriver.Options |
manage() |
org.openqa.selenium.WebDriver.Navigation |
navigate() |
void |
open(String url)
Opens the browser
|
void |
quit() |
void |
refresh()
Reloads the current URL
|
void |
selectFrame(IElement element)
Selects a new frame from within the current frame
|
void |
selectLastFrame()
Selects the previously selected frame
|
String |
selectPopupWindow()
Sets the most recently opened browser window as the active windwo for the
current WebDriver.
|
void |
selectWindow(String windowId)
Sets the active window for the current WebDriver
|
void |
setClickMode(boolean useJavascript)
Configures the use of JavaScript for clicking on interactive elements,
rather than relying on the native WebDriver methods
|
void |
setClientProperties(ClientProperties cp)
Sets the client configuration to use
|
void |
setFocusOnClick(boolean doFocus)
One of several options to determine if the focus method should actually
focus
|
void |
setHighlightColors(Map<String,String> colorMap) |
void |
setIsHighlight(boolean isHighlight)
Sets whether to highlight elements when performing actions
|
void |
setMaxRequestTimeout(String timeout)
Sets the maximum timeout value for actions
|
void |
setSessionId(String id)
Sets the current session to be used for all actions on ExtWebDdriver and
Widgets
|
void |
setTypeMode(boolean useJavascript)
Configures the use of JavaScript for entry of input fields, rather than
relying on the native WebDriver methods
|
void |
setWrappedDriver(org.openqa.selenium.WebDriver wd)
Replaces the underlying WebDriver instance
|
void |
storeCurrentWindowIds()
Stores handles for all existing windows for later comparison
|
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
void |
unselectFrame()
Selects the top most frame
|
void |
windowScroll(int i,
int j)
Scrolls the current browser window to specific position
|
void |
windowScrollBy(int i,
int j)
Scrolls the current browser by specific amount
|
public void setWrappedDriver(org.openqa.selenium.WebDriver wd)
ExtWebDriversetWrappedDriver in interface ExtWebDriverwd - the new WebDriver instancepublic void setClientProperties(ClientProperties cp)
cp - client configurationpublic void setTypeMode(boolean useJavascript)
ExtWebDriversetTypeMode in interface ExtWebDriveruseJavascript - true to enable the use of JavaScript, default is falsepublic boolean isJavascriptTypeMode()
ExtWebDriverisJavascriptTypeMode in interface ExtWebDriverpublic void setClickMode(boolean useJavascript)
ExtWebDriversetClickMode in interface ExtWebDriveruseJavascript - true to enable the use of JavaScript, default is falsepublic boolean isJavascriptClickMode()
ExtWebDriverisJavascriptClickMode in interface ExtWebDriverpublic void setFocusOnClick(boolean doFocus)
ExtWebDriversetFocusOnClick in interface ExtWebDriverdoFocus - true to force focus to the window as part of the click actionExtWebDriver.focus()public boolean isFocusOnClick()
ExtWebDriverisFocusOnClick in interface ExtWebDriverpublic void setIsHighlight(boolean isHighlight)
HighlightProvidersetIsHighlight in interface HighlightProviderisHighlight - whether to allow highlightpublic boolean isHighlight()
isHighlight in interface HighlightProviderpublic void setHighlightColors(Map<String,String> colorMap)
setHighlightColors in interface HighlightProviderpublic String getHighlightColor(String highlightMode)
HighlightProvidergetHighlightColor in interface HighlightProviderhighlightMode - the mode for which to get colorpublic void open(String url)
ExtWebDriveropen in interface ExtWebDriverurl - the web address for initial navigationpublic void back()
ExtWebDriverback in interface ExtWebDriverpublic void closeCurrentBrowser()
ExtWebDrivercloseCurrentBrowser in interface ExtWebDriverWebDriver.close()public void close()
close in interface org.openqa.selenium.WebDriverpublic void forward()
ExtWebDriverforward in interface ExtWebDriverpublic void refresh()
ExtWebDriverrefresh in interface ExtWebDriverpublic void storeCurrentWindowIds()
ExtWebDriverstoreCurrentWindowIds in interface ExtWebDriverExtWebDriver.selectPopupWindow()public void focus()
ExtWebDriverfocus in interface ExtWebDriverpublic void selectWindow(String windowId)
ExtWebDriverselectWindow in interface ExtWebDriverwindowId - the window id stringpublic String selectPopupWindow() throws ExtWebDriver.StaleWindowIdListException
ExtWebDriverExtWebDriver.storeCurrentWindowIds() was called before the window
opened and that only one window has opened since.selectPopupWindow in interface ExtWebDriverExtWebDriver.StaleWindowIdListException - when the difference between the stored window ids and the
current window ids is more than one windowpublic String[] getAllWindowIds()
ExtWebDrivergetAllWindowIds in interface ExtWebDriverpublic String getWindowId()
getWindowId in interface ExtWebDriverpublic void currentWindowMaximize()
currentWindowMaximize in interface ExtWebDriverpublic void windowScroll(int i,
int j)
windowScroll in interface ExtWebDriveri - Horizontal positionj - Vertical positionpublic void windowScrollBy(int i,
int j)
windowScrollBy in interface ExtWebDriveri - Horizontal scroll amountj - Vertical scroll amountpublic void eval(String javaScript)
ExtWebDrivereval in interface ExtWebDriverjavaScript - the script to executepublic String getHtmlSource()
ExtWebDrivergetHtmlSource in interface ExtWebDriverpublic Map<String,String> getGeneratedHtmlSource()
ExtWebDrivergetGeneratedHtmlSource in interface ExtWebDriverpublic void selectFrame(IElement element) throws Exception
ExtWebDriverselectFrame in interface ExtWebDriverelement - the object representing the iframe element to selectExceptionpublic void unselectFrame()
unselectFrame in interface ExtWebDriverpublic void selectLastFrame()
ExtWebDriverselectLastFrame in interface ExtWebDriverpublic String evaluateXpath(String xpath) throws Exception
ExtWebDriverevaluateXpath in interface ExtWebDriverxpath - the XPath to evaluateException - if the evaluation of the XPath failspublic void confirmNativeDialog()
throws Exception
ExtWebDriverconfirmNativeDialog in interface ExtWebDriverException - if the native dialog does not existpublic void cancelNativeDialog()
ExtWebDrivercancelNativeDialog in interface ExtWebDriverpublic String getNativeDialogText()
ExtWebDrivergetNativeDialogText in interface ExtWebDriverpublic String getBrowserName()
ExtWebDrivergetBrowserName in interface ExtWebDriverpublic String getBrowserVersion()
ExtWebDrivergetBrowserVersion in interface ExtWebDriverpublic org.openqa.selenium.WebElement findElement(org.openqa.selenium.By arg0)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverpublic List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebDriverpublic void get(String arg0)
get in interface org.openqa.selenium.WebDriverpublic String getCurrentUrl()
getCurrentUrl in interface org.openqa.selenium.WebDriverpublic String getPageSource()
getPageSource in interface org.openqa.selenium.WebDriverpublic String getTitle()
getTitle in interface org.openqa.selenium.WebDriverpublic String getWindowHandle()
getWindowHandle in interface org.openqa.selenium.WebDriverpublic Set<String> getWindowHandles()
getWindowHandles in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.Options manage()
manage in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.Navigation navigate()
navigate in interface org.openqa.selenium.WebDriverpublic void quit()
quit in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo in interface org.openqa.selenium.WebDriverpublic void setMaxRequestTimeout(String timeout)
ExtWebDriversetMaxRequestTimeout in interface ExtWebDrivertimeout - String representation millisecondspublic long getMaxRequestTimeout()
ExtWebDrivergetMaxRequestTimeout in interface ExtWebDriverpublic org.openqa.selenium.WebDriver getWrappedDriver()
ExtWebDrivergetWrappedDriver in interface ExtWebDriverpublic int getXpathCount(String string)
ExtWebDrivergetXpathCount in interface ExtWebDriverstring - the XPAth expression to countpublic void setSessionId(String id)
ExtWebDriversetSessionId in interface ExtWebDriverid - the identifier for the sessionpublic String getSessionId()
ExtWebDrivergetSessionId in interface ExtWebDriverCopyright © 2018. All rights reserved.