View Source

# namespace webdriver.until

## Functions

### ableToSwitchToFrame(frame)code »

Creates a condition that will wait until the input driver is able to switch to the designated frame. The target frame may be specified as

1. a numeric index into window.frames for the currently selected frame.
2. a `webdriver.WebElement`, which must reference a FRAME or IFRAME element on the current page.
3. a locator which may be used to first locate a FRAME or IFRAME on the current page before attempting to switch to it.

Upon successful resolution of this condition, the driver will be left focused on the new frame.

Parameters

frame`(number|webdriver.WebElement|webdriver.Locator|{className: string}|{css: string}|{id: string}|{js: string}|{linkText: string}|{name: string}|{partialLinkText: string}|{tagName: string}|{xpath: string})`

  The frame identifier.

Returns

`webdriver.until.Condition<boolean>`

  A new condition.

### alertIsPresent()code »

Creates a condition that waits for an alert to be opened. Upon success, the returned promise will be fulfilled with the handle for the opened alert.

Returns

`webdriver.until.Condition<webdriver.Alert>`

  The new condition.

### elementIsDisabled(element)code »

Creates a condition that will wait for the given element to be disabled.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementIsEnabled(element)code »

Creates a condition that will wait for the given element to be enabled.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementIsNotSelected(element)code »

Creates a condition that will wait for the given element to be deselected.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementIsNotVisible(element)code »

Creates a condition that will wait for the given element to be in the DOM, yet not visible to the user.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementIsSelected(element)code »

Creates a condition that will wait for the given element to be selected.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementIsVisible(element)code »

Creates a condition that will wait for the given element to become visible.

Parameters

element`webdriver.WebElement`

  The element to test.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementLocated(locator)code »

Creates a condition that will loop until an element is `found` with the given locator.

Parameters

locator`(webdriver.Locator|{className: string}|{css: string}|{id: string}|{js: string}|{linkText: string}|{name: string}|{partialLinkText: string}|{tagName: string}|{xpath: string})`

  The locator to use.

Returns

`webdriver.until.Condition<webdriver.WebElement>`

  The new condition.

### elementTextContains(element, substr)code »

Creates a condition that will wait for the given element's `visible text` to contain the given substring.

Parameters

element`webdriver.WebElement`

  The element to test.

substr`string`

  The substring to search for.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementTextIs(element, text)code »

Creates a condition that will wait for the given element's `visible text` to match the given `text` exactly.

Parameters

element`webdriver.WebElement`

  The element to test.

text`string`

  The expected text.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementTextMatches(element, regex)code »

Creates a condition that will wait for the given element's `visible text` to match a regular expression.

Parameters

element`webdriver.WebElement`

  The element to test.

regex`RegExp`

  The regular expression to test against.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### elementsLocated(locator)code »

Creates a condition that will loop until at least one element is `found` with the given locator.

Parameters

locator`(webdriver.Locator|{className: string}|{css: string}|{id: string}|{js: string}|{linkText: string}|{name: string}|{partialLinkText: string}|{tagName: string}|{xpath: string})`

  The locator to use.

Returns

`webdriver.until.Condition<Array<webdriver.WebElement>>`

  The new condition.

### stalenessOf(element)code »

Creates a condition that will wait for the given element to become stale. An element is considered stale once it is removed from the DOM, or a new page has loaded.

Parameters

element`webdriver.WebElement`

  The element that should become stale.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### titleContains(substr)code »

Creates a condition that will wait for the current page's title to contain the given substring.

Parameters

substr`string`

  The substring that should be present in the page title.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### titleIs(title)code »

Creates a condition that will wait for the current page's title to match the given value.

Parameters

title`string`

  The expected page title.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

### titleMatches(regex)code »

Creates a condition that will wait for the current page's title to match the given regular expression.

Parameters

regex`RegExp`

  The regular expression to test against.

Returns

`webdriver.until.Condition<boolean>`

  The new condition.

## Types

Condition

  Defines a condition to