Class SelenideTargetLocator

  • All Implemented Interfaces:
    org.openqa.selenium.WebDriver.TargetLocator

    @ParametersAreNonnullByDefault
    public class SelenideTargetLocator
    extends java.lang.Object
    implements org.openqa.selenium.WebDriver.TargetLocator
    • Constructor Summary

      Constructors 
      Constructor Description
      SelenideTargetLocator​(Config config, org.openqa.selenium.WebDriver webDriver)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.openqa.selenium.WebElement activeElement()  
      org.openqa.selenium.Alert alert()  
      org.openqa.selenium.WebDriver defaultContent()  
      org.openqa.selenium.WebDriver frame​(int index)  
      org.openqa.selenium.WebDriver frame​(java.lang.String nameOrId)  
      org.openqa.selenium.WebDriver frame​(org.openqa.selenium.WebElement frameElement)  
      org.openqa.selenium.WebDriver innerFrame​(java.lang.String... frames)
      Switch to the inner frame (last child frame in given sequence)
      org.openqa.selenium.WebDriver parentFrame()  
      org.openqa.selenium.WebDriver window​(int index)
      Switch to window/tab by index NB! Order of windows/tabs can be different in different browsers, see Selenide tests.
      org.openqa.selenium.WebDriver window​(int index, java.time.Duration duration)
      Switch to window/tab by index with a configurable timeout NB! Order of windows/tabs can be different in different browsers, see Selenide tests.
      org.openqa.selenium.WebDriver window​(java.lang.String nameOrHandleOrTitle)
      Switch to window/tab by name/handle/title
      org.openqa.selenium.WebDriver window​(java.lang.String nameOrHandleOrTitle, java.time.Duration duration)
      Switch to window/tab by name/handle/title with a configurable timeout
      protected static org.openqa.selenium.WebDriver windowByTitle​(org.openqa.selenium.WebDriver driver, java.lang.String title)
      Switch to window/tab by name/handle/title except some windows handles
      • Methods inherited from class java.lang.Object

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

      • SelenideTargetLocator

        public SelenideTargetLocator​(Config config,
                                     org.openqa.selenium.WebDriver webDriver)
    • Method Detail

      • frame

        @Nonnull
        public org.openqa.selenium.WebDriver frame​(int index)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • frame

        @Nonnull
        public org.openqa.selenium.WebDriver frame​(java.lang.String nameOrId)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • frame

        @Nonnull
        public org.openqa.selenium.WebDriver frame​(org.openqa.selenium.WebElement frameElement)
        Specified by:
        frame in interface org.openqa.selenium.WebDriver.TargetLocator
      • parentFrame

        @Nonnull
        public org.openqa.selenium.WebDriver parentFrame()
        Specified by:
        parentFrame in interface org.openqa.selenium.WebDriver.TargetLocator
      • defaultContent

        @Nonnull
        public org.openqa.selenium.WebDriver defaultContent()
        Specified by:
        defaultContent in interface org.openqa.selenium.WebDriver.TargetLocator
      • activeElement

        @Nonnull
        public org.openqa.selenium.WebElement activeElement()
        Specified by:
        activeElement in interface org.openqa.selenium.WebDriver.TargetLocator
      • alert

        @Nonnull
        public org.openqa.selenium.Alert alert()
        Specified by:
        alert in interface org.openqa.selenium.WebDriver.TargetLocator
      • innerFrame

        @Nonnull
        public org.openqa.selenium.WebDriver innerFrame​(java.lang.String... frames)
        Switch to the inner frame (last child frame in given sequence)
      • window

        @CheckReturnValue
        @Nonnull
        public org.openqa.selenium.WebDriver window​(int index)
        Switch to window/tab by index NB! Order of windows/tabs can be different in different browsers, see Selenide tests.
        Parameters:
        index - index of window (0-based)
      • window

        @CheckReturnValue
        @Nonnull
        public org.openqa.selenium.WebDriver window​(int index,
                                                    java.time.Duration duration)
        Switch to window/tab by index with a configurable timeout NB! Order of windows/tabs can be different in different browsers, see Selenide tests.
        Parameters:
        index - index of window (0-based)
        duration - the timeout duration. It overrides default Config.timeout()
      • window

        @CheckReturnValue
        @Nonnull
        public org.openqa.selenium.WebDriver window​(java.lang.String nameOrHandleOrTitle)
        Switch to window/tab by name/handle/title
        Specified by:
        window in interface org.openqa.selenium.WebDriver.TargetLocator
        Parameters:
        nameOrHandleOrTitle - name or handle or title of window/tab
      • window

        @CheckReturnValue
        @Nonnull
        public org.openqa.selenium.WebDriver window​(java.lang.String nameOrHandleOrTitle,
                                                    java.time.Duration duration)
        Switch to window/tab by name/handle/title with a configurable timeout
        Parameters:
        nameOrHandleOrTitle - name or handle or title of window/tab
        duration - the timeout duration. It overrides default Config.timeout()
      • windowByTitle

        @CheckReturnValue
        @Nonnull
        protected static org.openqa.selenium.WebDriver windowByTitle​(org.openqa.selenium.WebDriver driver,
                                                                     java.lang.String title)
        Switch to window/tab by name/handle/title except some windows handles
        Parameters:
        title - title of window/tab