javascript - Protractor Exceptions Codes -
i need handle exceptions no element found using locator:
in protractor tests can provide better error message.
viewcompanydocumentpage.getattachmenttype().then(function (type) { // handle success }, function (err) { console.log(err); });
when console.log()
error object given has value called code
, has value 7 above exception. can use error code provide better messages. can find other exceptions thrown protractor element locators , codes?
one option here follow page object pattern of astrolabe
package:
astrolabe extension protractor adds page objects functional/e2e tests.
aside other features, there convenient way define own exceptions custom messages inside page objects.
also see:
Comments
Post a Comment