You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating to Webdriverio v4.7.0, isExisting() raises an error when called on a nonexistent element.
Environment
WebdriverIO version: New in 4.7.0. Not present in 4.6.2.
Node.js version: v6.2.0
wdio testrunner in synchronous mode
Additional wdio packages used (if applicable):
wdio-dot-reporter@0.0.6
wdio-jasmine-framework@0.2.19
wdio-junit-reporter@0.1.0
wdio-selenium-standalone-service@0.0.6
Details
Sample test
describe('test isExisting',function(){it('should not raise an error for nonexistent element',function(){expect(browser.element('#nonexistent').isExisting()).toBeFalsy();});});
Test results on v4.7.0:
F
0 passing (5.00s)
1 failing
1) test isExistingsuite1 should not raise an error for nonexistent element:
Failed: An element could not be located on the page using the given search parameters ("#nonexistent").
running chrome
Error: An element could not be located on the page using the given search parameters ("#nonexistent").
at isExisting() - at Object.<anonymous> (spec.js:3:44)
Looking into this some more, it seems like the issue is actually in browser.element(). In 4.6.2 it did not raise an error for a nonexistent selector, so calling .isExisting() worked. In 4.7.0 it seems to raise an error so .isExisting() never gets called.
The problem
I use the
element.isExisting()
method to test whether an element exists without having to catch an error, as described in the docs http://webdriver.io/api/state/isExisting.html .After updating to Webdriverio v4.7.0,
isExisting()
raises an error when called on a nonexistent element.Environment
Details
Sample test
Test results on v4.7.0:
Test results on v4.6.2:
Link to Selenium/WebdriverIO logs
https://gist.github.com/selenetelenav/74ba5f0df9684b0d35fff8f51c56572f
Code To Reproduce Issue [ Good To Have ]
(included in details)
The text was updated successfully, but these errors were encountered: