Skip to content

Commit 3dfc66b

Browse files
committed
[js] For consistency across languages, deprecate isElementPresent(). Since this
has been around for several years, it won't be removed until 3.0
1 parent 7280490 commit 3dfc66b

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

javascript/node/selenium-webdriver/CHANGES.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v2.53.0-dev
2+
3+
### Change Summary
4+
5+
* For consistency with the other Selenium language bindings,
6+
`WebDriver#isElementPresent()` and `WebElement#isElementPresent()` have
7+
been deprecated. These methods will be removed in v3.0. Use the findElements
8+
command to test for the presence of an element:
9+
10+
driver.findElements(By.css('.foo')).then(found => !!found.length);
11+
12+
113
## v2.52.0
214

315
### Notice

javascript/node/selenium-webdriver/lib/webdriver.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,11 @@ class WebDriver {
872872
* @param {!(by.By|Function)} locator The locator to use.
873873
* @return {!promise.Promise<boolean>} A promise that will resolve
874874
* with whether the element is present on the page.
875+
* @deprecated This method will be removed in Selenium 3.0 for consistency
876+
* with the other Selenium language bindings. This method is equivalent
877+
* to
878+
*
879+
* driver.findElements(locator).then(e => !!e.length);
875880
*/
876881
isElementPresent(locator) {
877882
return this.findElements.apply(this, arguments).then(function(result) {
@@ -1769,6 +1774,11 @@ class WebElement {
17691774
* searching for the element.
17701775
* @return {!promise.Promise<boolean>} A promise that will be
17711776
* resolved with whether an element could be located on the page.
1777+
* @deprecated This method will be removed in Selenium 3.0 for consistency
1778+
* with the other Selenium language bindings. This method is equivalent
1779+
* to
1780+
*
1781+
* element.findElements(locator).then(e => !!e.length);
17721782
*/
17731783
isElementPresent(locator) {
17741784
return this.findElements(locator).then(function(result) {

javascript/node/selenium-webdriver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "selenium-webdriver",
3-
"version": "2.52.0",
3+
"version": "2.53.0-dev",
44
"description": "The official WebDriver JavaScript bindings from the Selenium project",
55
"license": "Apache-2.0",
66
"keywords": [

0 commit comments

Comments
 (0)