public final class WebDriverUnpackUtility
extends java.lang.Object
Constructor and Description |
---|
WebDriverUnpackUtility() |
Modifier and Type | Method and Description |
---|---|
static ContentType |
getCurrentContentType(SearchContext context) |
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
WrapsElement
WebDriver
.
Note: if the given SearchContext
is not
WebDriver
and it doesn't implement
WrapsDriver
or
WrapsElement
then this method returns
null.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
WrapsDriver
or
HasSessionDetails
ContentType.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 WrapsDriver