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
This is more of a guidance than an issue. I do have stack overflow question open for a while now and thought I'll ask here..sorry ..
I'm looking for guidance to handle browser exceptions in a central place instead of that being thrown out from the PageObjects classes. I'd like to be able to return a custom object with custom error message and stack trace from PageObject class back to the test and let the test handle, use the information for reporting etc..is it possible?
For example, I've my test like this
browser.setValue(_elements.searchbox, envSettings.searchTerm).catch((e)=>{
let msg = {
isSuccess: false,
description: "failed while setting value in google search box",
stacktrace: e
}
return Q.reject(msg);
})
when I run the test, I get this error
browser.setValue(...).catch is not a function
Whats the best way to bubble up all browser errors to a common handler?
browser.setValue(...).catch is not a function no wonder, since your are running commands synchronously. You could loop over all commands the browser variable provides and overwrite them using try/catch.
The problem
This is more of a guidance than an issue. I do have stack overflow question open for a while now and thought I'll ask here..sorry ..
I'm looking for guidance to handle browser exceptions in a central place instead of that being thrown out from the PageObjects classes. I'd like to be able to return a custom object with custom error message and stack trace from PageObject class back to the test and let the test handle, use the information for reporting etc..is it possible?
For example, I've my test like this
when I run the test, I get this error
Whats the best way to bubble up all browser errors to a common handler?
Environment
The text was updated successfully, but these errors were encountered: