public final class WebDriverUnpackUtility extends Object
| Constructor and Description |
|---|
WebDriverUnpackUtility() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getAutomation(WebDriver driver) |
static ContentType |
getCurrentContentType(SearchContext context) |
static String |
getPlatform(WebDriver driver) |
static WebDriver |
unpackWebDriverFromSearchContext(SearchContext searchContext)
This method extract an instance of
WebDriver from the given
SearchContext. |
public static WebDriver unpackWebDriverFromSearchContext(SearchContext searchContext)
WebDriver from the given
SearchContext.searchContext - is an instance of SearchContext
It may be the instance of WebDriver
or WebElement or some other user's
extension/implementation.
Note: if you want to use your own implementation then it should implement
WrapsDriver or
WrapsElementWebDriver.
Note: if the given SearchContext is not
WebDriver and it doesn't implement
WrapsDriver or
WrapsElement then this method returns
null.public static String getPlatform(WebDriver driver)
driver - is an instance of WebDriver.MobilePlatform.
Note: the given WebDriver should implementpublic static String getAutomation(WebDriver driver)
driver - is an instance of WebDriver.AutomationName.
Note: the given WebDriver should implement
HasCapabilities also. This method will return null
otherwise.public static ContentType getCurrentContentType(SearchContext context)
context - is an instance of SearchContext
It may be the instance of WebDriver
or WebElement or some other user's
extension/implementation.
Note: if you want to use your own implementation then it should
implement ContextAware or
WrapsDriverContentType.NATIVE_MOBILE_SPECIFIC.
ContentType.HTML_OR_DEFAULT will be returned
if the current context is WEB_VIEW.
ContentType.HTML_OR_DEFAULT also will be
returned if the given SearchContext
instance doesn't implement
ContextAware and WrapsDriverCopyright © 2016. All rights reserved.