ChromeDriver / Spinach / Selenium error: could not read the "localStorage" property from the "window": storage is disabled inside the "data:" URL

I get an error in spinach tests (Ruby on Rails). Each test does not work for the same reason:

<unknown>: Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs. (Session info: chrome=46.0.2490.86) (Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Mac OS X 10.10.5 x86_64) 

An example of a failed validation step from Spinach:

 step 'I visit the site' do visit "/top?DEBUG_USER=#{$spinach_test_userid}" page.execute_script('localStorage.clear()') # clear localStorage and reload to act as fresh login visit "/top?DEBUG_USER=#{$spinach_test_userid}" end 

Ideas?

Customization includes RSpec, Capybara, Spinach, Chromedriver, Selenium. Code includes Mongo, Node.js, Rails ...

UPDATE: I realized that the tests were not configured to run the application before running the test, so he tried to find the local storage without visiting the page first ("page not found"). Starting the application manually on a separate tab of the terminal solved the problem. Leaving this question to the next n00b who needs help .; -)

+6
source share

All Articles