public final class WebDriverUnpackUtility extends Object
Constructor and Description |
---|
WebDriverUnpackUtility() |
Modifier and Type | Method and Description |
---|---|
static String |
getAutomation(org.openqa.selenium.WebDriver driver) |
static ContentType |
getCurrentContentType(org.openqa.selenium.SearchContext context) |
static String |
getPlatform(org.openqa.selenium.WebDriver driver) |
static org.openqa.selenium.WebDriver |
unpackWebDriverFromSearchContext(org.openqa.selenium.SearchContext searchContext)
This method extract an instance of
WebDriver from the given
SearchContext . |
public static org.openqa.selenium.WebDriver unpackWebDriverFromSearchContext(org.openqa.selenium.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 String getPlatform(org.openqa.selenium.WebDriver driver)
driver
- is an instance of WebDriver
.MobilePlatform
.
Note: the given WebDriver
should implementpublic static String getAutomation(org.openqa.selenium.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(org.openqa.selenium.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
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
Copyright © 2016. All rights reserved.