com.atlassian.pageobjects.elements
Class WebDriverLocators

java.lang.Object
  extended by com.atlassian.pageobjects.elements.WebDriverLocators

@Internal
public class WebDriverLocators
extends Object

Creates WebDriveLocatables for different search strategies.


Constructor Summary
WebDriverLocators()
           
 
Method Summary
static boolean isStale(org.openqa.selenium.WebElement webElement)
          Whether the given WebElement is stale and needs to be relocated.
static WebDriverLocatable list(org.openqa.selenium.WebElement element, org.openqa.selenium.By locator, int locatorIndex, WebDriverLocatable parent)
          Creates a WebDriverLocatable for an element included in a list initialized with given element.
static WebDriverLocatable nested(org.openqa.selenium.By locator, WebDriverLocatable parent)
          Creates a WebDriverLocatable for a single element nested within another locatable.
static WebDriverLocatable root()
          Creates the root of a WebDriverLocatable list, usually the instance of WebDriver.
static WebDriverLocatable single(org.openqa.selenium.By locator)
          Creates a WebDriverLocatable for a single element in global context.
static WebDriverLocatable staticElement(org.openqa.selenium.WebElement element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverLocators

public WebDriverLocators()
Method Detail

root

@Nonnull
public static WebDriverLocatable root()
Creates the root of a WebDriverLocatable list, usually the instance of WebDriver.

Returns:
WebDriverLocatable

single

@Nonnull
public static WebDriverLocatable single(org.openqa.selenium.By locator)
Creates a WebDriverLocatable for a single element in global context.

Parameters:
locator - The locator strategy within the parent. It will be applied in the global search context
Returns:
WebDriverLocatable

nested

@Nonnull
public static WebDriverLocatable nested(org.openqa.selenium.By locator,
                                                WebDriverLocatable parent)
Creates a WebDriverLocatable for a single element nested within another locatable.

Parameters:
locator - The locator strategy within the parent
parent - The parent locatable
Returns:
WebDriverLocatable for a single nested element

list

@Nonnull
public static WebDriverLocatable list(org.openqa.selenium.WebElement element,
                                              org.openqa.selenium.By locator,
                                              int locatorIndex,
                                              WebDriverLocatable parent)
Creates a WebDriverLocatable for an element included in a list initialized with given element.

Parameters:
element - WebElement
locator - The locator strategy within the parent that will produce a list of matches
locatorIndex - The index within the list of matches to find this element
parent - The locatable for the parent
Returns:
WebDriverLocatable

staticElement

@Nonnull
public static WebDriverLocatable staticElement(org.openqa.selenium.WebElement element)

isStale

public static boolean isStale(org.openqa.selenium.WebElement webElement)
Whether the given WebElement is stale and needs to be relocated.

Parameters:
webElement - web element to examine
Returns:
true if element reference is stale, false otherwise


Copyright © 2014 Atlassian. All rights reserved.