In order to improve error handling in my Protractor tests, I am exploring how to handle exceptions such as No element found using locator:
and provide more informative error messages.
viewCompanyDocumentPage.getAttachmentType().then(function (type) {
// Handle the success
}, function (err) {
console.log(err);
});
Upon console.log()
of the error object, I discovered a code
value of 7 for the mentioned exception. This code can be utilized to enhance error messaging. However, I am curious about where to find information on other exceptions thrown by Protractor element locators and their corresponding error codes.