-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[services/remote] wrap up clearing browser storage with try/catch #50840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[services/remote] wrap up clearing browser storage with try/catch #50840
Conversation
💚 Build Succeeded |
|
@elasticmachine merge upstream |
💚 Build Succeeded |
…clear-session-storage
…mlemeshko/kibana into fix/ftr-fails-to-clear-session-storage
| try { | ||
| await driver.executeScript(`window.${storageType}.clear();`); | ||
| } catch (error) { | ||
| if (!error.message.includes(`Failed to read the ${storageType} property from 'Window'`)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to have single quotes around the storage type, which one is correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right Spencer, I actually tested with quotes 😫
spalger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💔 Build Failed |
💚 Build Succeeded |
…astic#50840) * [services/remote] wrap up clearing storage with try/catch * improve error handling on clearing storage * apply awesome idea * fix exception message
…astic#50840) * [services/remote] wrap up clearing storage with try/catch * improve error handling on clearing storage * apply awesome idea * fix exception message
wayneseymour
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
Fixing the error
WebDriverError: <unknown>: Failed to read the 'sessionStorage' property from 'Window': Storage is disabled inside 'data:' URLs.that occurs while storage clearing when it is actually emptyCurrently, if the session or local storage clearing fails, WebDriver throws an error like
This PR wraps operations with try/catch and do not fail operation unless different error message is returned. This message won't be logged into console output.