Class WebDriverUnpackUtility


  • public final class WebDriverUnpackUtility
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ContentType getCurrentContentType​(org.openqa.selenium.SearchContext context)
      Detects content type by the provided search context.
      static org.openqa.selenium.WebDriver unpackWebDriverFromSearchContext​(org.openqa.selenium.SearchContext searchContext)
      This method extract an instance of WebDriver from the given SearchContext.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebDriverUnpackUtility

        public WebDriverUnpackUtility()
    • Method Detail

      • unpackWebDriverFromSearchContext

        public static org.openqa.selenium.WebDriver unpackWebDriverFromSearchContext​(org.openqa.selenium.SearchContext searchContext)
        This method extract an instance of WebDriver from the given SearchContext.
        Parameters:
        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
        Returns:
        the instance of WebDriver. Note: if the given SearchContext is not WebDriver and it doesn't implement WrapsDriver or WrapsElement then this method returns null.
      • getCurrentContentType

        public static ContentType getCurrentContentType​(org.openqa.selenium.SearchContext context)
        Detects content type by the provided search context.
        Parameters:
        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 HasBrowserCheck
        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_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