Interface SupportsContextSwitching

  • All Superinterfaces:
    org.openqa.selenium.ContextAware, ExecutesMethod, org.openqa.selenium.SearchContext, org.openqa.selenium.WebDriver
    All Known Implementing Classes:
    AndroidDriver, IOSDriver

    public interface SupportsContextSwitching
    extends org.openqa.selenium.WebDriver, org.openqa.selenium.ContextAware, ExecutesMethod
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver

        org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default org.openqa.selenium.WebDriver context​(java.lang.String name)
      Switches to the given context.
      default java.lang.String getContext()
      Get the name of the current context.
      default java.util.Set<java.lang.String> getContextHandles()
      Get the names of available contexts.
      • Methods inherited from interface org.openqa.selenium.WebDriver

        close, findElement, findElements, get, getCurrentUrl, getPageSource, getTitle, getWindowHandle, getWindowHandles, manage, navigate, quit, switchTo
    • Method Detail

      • context

        default org.openqa.selenium.WebDriver context​(java.lang.String name)
        Switches to the given context.
        Specified by:
        context in interface org.openqa.selenium.ContextAware
        Parameters:
        name - The name of the context to switch to.
        Returns:
        self instance for chaining.
      • getContextHandles

        default java.util.Set<java.lang.String> getContextHandles()
        Get the names of available contexts.
        Specified by:
        getContextHandles in interface org.openqa.selenium.ContextAware
        Returns:
        List list of context names.
      • getContext

        @Nullable
        default java.lang.String getContext()
        Get the name of the current context.
        Specified by:
        getContext in interface org.openqa.selenium.ContextAware
        Returns:
        Context name or null if it cannot be determined.