Class WebDriverUnpackUtility
- java.lang.Object
-
- io.appium.java_client.pagefactory.utils.WebDriverUnpackUtility
-
public final class WebDriverUnpackUtility extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description WebDriverUnpackUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ContentTypegetCurrentContentType(org.openqa.selenium.SearchContext context)Detects content type by the provided searchcontext.static org.openqa.selenium.WebDriverunpackWebDriverFromSearchContext(org.openqa.selenium.SearchContext searchContext)This method extract an instance ofWebDriverfrom the givenSearchContext.
-
-
-
Method Detail
-
unpackWebDriverFromSearchContext
public static org.openqa.selenium.WebDriver unpackWebDriverFromSearchContext(org.openqa.selenium.SearchContext searchContext)
This method extract an instance ofWebDriverfrom the givenSearchContext.- Parameters:
searchContext- is an instance ofSearchContext. It may be the instance ofWebDriverorWebElementor some other user's extension/implementation. Note: if you want to use your own implementation then it should implementWrapsDriverorWrapsElement- Returns:
- the instance of
WebDriver. Note: if the givenSearchContextis notWebDriverand it doesn't implementWrapsDriverorWrapsElementthen this method returns null.
-
getCurrentContentType
public static ContentType getCurrentContentType(org.openqa.selenium.SearchContext context)
Detects content type by the provided searchcontext.- Parameters:
context- is an instance ofSearchContext. It may be the instance ofWebDriverorWebElementor some other user's extension/implementation. Note: if you want to use your own implementation then it should implementContextAwareorWrapsDriverorHasBrowserCheck- Returns:
- current content type. It depends on current context. If current context is
NATIVE_APP it will return
ContentType.NATIVE_MOBILE_SPECIFIC.ContentType.HTML_OR_DEFAULTwill be returned if the current context is WEB_VIEW.ContentType.HTML_OR_DEFAULTalso will be returned if the givenSearchContextinstance doesn't implementContextAwareandWrapsDriver
-
-