Skip to content
This repository has been archived by the owner on May 22, 2018. It is now read-only.

Commit

Permalink
[js] For consistency across languages, deprecate isElementPresent(). …
Browse files Browse the repository at this point in the history
…Since this

has been around for several years, it won't be removed until 3.0
  • Loading branch information
jleyba committed Feb 19, 2016
1 parent 7280490 commit 3dfc66b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
12 changes: 12 additions & 0 deletions javascript/node/selenium-webdriver/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## v2.53.0-dev

### Change Summary

* For consistency with the other Selenium language bindings,
`WebDriver#isElementPresent()` and `WebElement#isElementPresent()` have
been deprecated. These methods will be removed in v3.0. Use the findElements
command to test for the presence of an element:

driver.findElements(By.css('.foo')).then(found => !!found.length);


## v2.52.0

### Notice
Expand Down
10 changes: 10 additions & 0 deletions javascript/node/selenium-webdriver/lib/webdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,11 @@ class WebDriver {
* @param {!(by.By|Function)} locator The locator to use.
* @return {!promise.Promise<boolean>} A promise that will resolve
* with whether the element is present on the page.
* @deprecated This method will be removed in Selenium 3.0 for consistency
* with the other Selenium language bindings. This method is equivalent
* to
*
* driver.findElements(locator).then(e => !!e.length);
*/
isElementPresent(locator) {
return this.findElements.apply(this, arguments).then(function(result) {
Expand Down Expand Up @@ -1769,6 +1774,11 @@ class WebElement {
* searching for the element.
* @return {!promise.Promise<boolean>} A promise that will be
* resolved with whether an element could be located on the page.
* @deprecated This method will be removed in Selenium 3.0 for consistency
* with the other Selenium language bindings. This method is equivalent
* to
*
* element.findElements(locator).then(e => !!e.length);
*/
isElementPresent(locator) {
return this.findElements(locator).then(function(result) {
Expand Down
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selenium-webdriver",
"version": "2.52.0",
"version": "2.53.0-dev",
"description": "The official WebDriver JavaScript bindings from the Selenium project",
"license": "Apache-2.0",
"keywords": [
Expand Down

0 comments on commit 3dfc66b

Please sign in to comment.