Skip to content

Conversation

@dmlemeshko
Copy link
Member

@dmlemeshko dmlemeshko commented Nov 16, 2019

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 empty

Currently, if the session or local storage clearing fails, WebDriver throws an error like

WebDriverError: <unknown>: Failed to read the 'sessionStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
  (Session info: chrome=78.0.3904.97)
  (Driver info: chromedriver=78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}),platform=Mac OS X 10.14.6 x86_64)

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.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dmlemeshko
Copy link
Member Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dmlemeshko dmlemeshko marked this pull request as ready for review November 18, 2019 15:02
@dmlemeshko dmlemeshko requested a review from spalger November 19, 2019 20:14
try {
await driver.executeScript(`window.${storageType}.clear();`);
} catch (error) {
if (!error.message.includes(`Failed to read the ${storageType} property from 'Window'`)) {
Copy link
Contributor

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?

Copy link
Member Author

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 😫

@dmlemeshko dmlemeshko requested a review from spalger November 19, 2019 21:29
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@dmlemeshko dmlemeshko merged commit 295f1df into elastic:master Nov 19, 2019
dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Nov 19, 2019
…astic#50840)

* [services/remote] wrap up clearing storage with try/catch

* improve error handling on clearing storage

* apply awesome idea

* fix exception message
dmlemeshko added a commit to dmlemeshko/kibana that referenced this pull request Nov 19, 2019
…astic#50840)

* [services/remote] wrap up clearing storage with try/catch

* improve error handling on clearing storage

* apply awesome idea

* fix exception message
dmlemeshko added a commit that referenced this pull request Nov 20, 2019
…0840) (#51127)

* [services/remote] wrap up clearing storage with try/catch

* improve error handling on clearing storage

* apply awesome idea

* fix exception message
dmlemeshko added a commit that referenced this pull request Nov 20, 2019
…0840) (#51130)

* [services/remote] wrap up clearing storage with try/catch

* improve error handling on clearing storage

* apply awesome idea

* fix exception message
Copy link
Contributor

@wayneseymour wayneseymour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmlemeshko dmlemeshko deleted the fix/ftr-fails-to-clear-session-storage branch March 24, 2020 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants