com.atlassian.pageobjects.elements
Interface WebDriverLocatable


@Internal
public interface WebDriverLocatable

A SearchContext that can be located by WebDriver, capable of re-locating. A locatable consists of locator used to locate itself, and the parent locatable that forms a search context, in which we locate this locatable.

Locatables form a list representing the parent-child relationship of SearchContexts. The root locatable is always the locatable for WebDriver itself (think of it as a global search context). To locate a SearchContext, first the parent is located then the locator is applied to it.

Since:
2.0

Nested Class Summary
static class WebDriverLocatable.LocateTimeout
          Provides information about timeout and poll interval to use while performing locatable operations.
 
Method Summary
 org.openqa.selenium.By getLocator()
          Gets the WebDriver locator for this SearchContext.
 WebDriverLocatable getParent()
          The parent of this SearchContext.
 boolean isPresent(org.openqa.selenium.WebDriver driver, int timeoutInSeconds)
          Deprecated. use isPresent(WebDriver, WebDriverLocatable.LocateTimeout) instead. Scheduled for removal in 3.0
 boolean isPresent(org.openqa.selenium.WebDriver driver, WebDriverLocatable.LocateTimeout timeout)
          Whether this SearchContext is present, given its parent is located by timeout.
 org.openqa.selenium.SearchContext waitUntilLocated(org.openqa.selenium.WebDriver driver, int timeoutInSeconds)
          Deprecated. use waitUntilLocated(WebDriver, WebDriverLocatable.LocateTimeout) instead. Scheduled for removal in 3.0
 org.openqa.selenium.SearchContext waitUntilLocated(org.openqa.selenium.WebDriver driver, WebDriverLocatable.LocateTimeout timeout)
          Wait until the SearchContext represented by this locatable is located.
 

Method Detail

getLocator

@Nullable
org.openqa.selenium.By getLocator()
Gets the WebDriver locator for this SearchContext.

Returns:
Locator, null if root.

getParent

@Nullable
WebDriverLocatable getParent()
The parent of this SearchContext.

Returns:
The locatable for the parent, null if root.

waitUntilLocated

@Deprecated
@Nonnull
org.openqa.selenium.SearchContext waitUntilLocated(@Nonnull
                                                                      org.openqa.selenium.WebDriver driver,
                                                                      int timeoutInSeconds)
                                                   throws org.openqa.selenium.NoSuchElementException
Deprecated. use waitUntilLocated(WebDriver, WebDriverLocatable.LocateTimeout) instead. Scheduled for removal in 3.0

Wait until this SearchContext represented by this locatable is located.

Parameters:
driver - the WebDriver instance.
timeoutInSeconds - timeout to wait until located, must be >= 0.
Returns:
SearchContext
Throws:
org.openqa.selenium.NoSuchElementException - if context could not be located before timeout expired

isPresent

@Deprecated
boolean isPresent(@Nonnull
                             org.openqa.selenium.WebDriver driver,
                             int timeoutInSeconds)
Deprecated. use isPresent(WebDriver, WebDriverLocatable.LocateTimeout) instead. Scheduled for removal in 3.0

Whether this SearchContext is present by given timeout.

Parameters:
driver - the WebDriver instance.
timeoutInSeconds - timeout to wait until parent is located, must be >= 0
Returns:
true if SearchContext is located before the timeout expires, false otherwise.

waitUntilLocated

@Nonnull
org.openqa.selenium.SearchContext waitUntilLocated(@Nonnull
                                                           org.openqa.selenium.WebDriver driver,
                                                           @Nonnull
                                                           WebDriverLocatable.LocateTimeout timeout)
                                                   throws org.openqa.selenium.NoSuchElementException
Wait until the SearchContext represented by this locatable is located.

Parameters:
driver - the WebDriver instance.
timeout - LocateTimeout instance specifying the time to wait until located, must be >= 0.
Returns:
SearchContext
Throws:
org.openqa.selenium.NoSuchElementException - if context could not be located before timeout expired
See Also:
WebDriverLocatable.LocateTimeout, SearchContext

isPresent

boolean isPresent(@Nonnull
                  org.openqa.selenium.WebDriver driver,
                  @Nonnull
                  WebDriverLocatable.LocateTimeout timeout)
Whether this SearchContext is present, given its parent is located by timeout.

Parameters:
driver - the WebDriver instance.
timeout - LocateTimeout instance specifying the time to wait until the parent is located, must be >= 0.
Returns:
true if the SearchContext is located before the timeout expires, false otherwise
See Also:
WebDriverLocatable.LocateTimeout


Copyright © 2014 Atlassian. All rights reserved.