Class SelenideTargetLocator

java.lang.Object
com.codeborne.selenide.SelenideTargetLocator
All Implemented Interfaces:
org.openqa.selenium.WebDriver.TargetLocator

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openqa.selenium.WebElement
     
    org.openqa.selenium.Alert
     
    org.openqa.selenium.Alert
    alert(Duration timeout)
     
    org.openqa.selenium.WebDriver
     
    org.openqa.selenium.WebDriver
    frame(int index)
    Switch to frame by index NB! Order of frames can be different in different browsers, see Selenide tests.
    org.openqa.selenium.WebDriver
    frame(int index, Duration timeout)
    Switch to frame by index with a configurable timeout NB! Order of frames can be different in different browsers, see Selenide tests.
    org.openqa.selenium.WebDriver
    frame(String nameOrId)
    Switch to frame by name or id
    org.openqa.selenium.WebDriver
    frame(String nameOrId, Duration timeout)
    Switch to frame by name or id with a configurable timeout
    org.openqa.selenium.WebDriver
    frame(org.openqa.selenium.WebElement frameElement)
     
    void
    innerFrame(String firstFrame, String... otherFrames)
    Switch to the inner frame (last child frame in given sequence).
    org.openqa.selenium.WebDriver
    newWindow(org.openqa.selenium.WindowType typeHint)
     
    org.openqa.selenium.WebDriver
     
    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, Duration timeout)
    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(String nameOrHandleOrTitle)
    Switch to window/tab by name/handle/title
    org.openqa.selenium.WebDriver
    window(String nameOrHandleOrTitle, Duration timeout)
    Switch to window/tab by name/handle/title with a configurable timeout

    Methods inherited from class java.lang.Object

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

    • SelenideTargetLocator

      public SelenideTargetLocator(Driver driver)
  • Method Details

    • frame

      @Nonnull public org.openqa.selenium.WebDriver frame(int index)
      Switch to frame by index NB! Order of frames can be different in different browsers, see Selenide tests.
      Specified by:
      frame in interface org.openqa.selenium.WebDriver.TargetLocator
      Parameters:
      index - index of frame (0-based)
    • frame

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

      @Nonnull public org.openqa.selenium.WebDriver frame(String nameOrId)
      Switch to frame by name or id
      Specified by:
      frame in interface org.openqa.selenium.WebDriver.TargetLocator
      Parameters:
      nameOrId - name or id of frame
    • frame

      @Nonnull public org.openqa.selenium.WebDriver frame(String nameOrId, Duration timeout)
      Switch to frame by name or id with a configurable timeout
      Parameters:
      nameOrId - name or id of frame
      timeout - the timeout duration. It overrides default Config.timeout()
    • 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
    • alert

      @Nonnull public org.openqa.selenium.Alert alert(@Nullable Duration timeout)
    • innerFrame

      public void innerFrame(String firstFrame, String... otherFrames)
      Switch to the inner frame (last child frame in given sequence).

      This method

      1. switches to the root frame (aka "default content"),
      2. switches to "firstFrame",
      3. switches to every of "otherFrames".
    • window

      @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

      @Nonnull public org.openqa.selenium.WebDriver window(int index, Duration timeout)
      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)
      timeout - the timeout duration. It overrides default Config.timeout()
    • window

      @Nonnull public org.openqa.selenium.WebDriver window(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

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

      public org.openqa.selenium.WebDriver newWindow(org.openqa.selenium.WindowType typeHint)
      Specified by:
      newWindow in interface org.openqa.selenium.WebDriver.TargetLocator