I'm doing e2e tests with the help of phantom and protractor, however each time I do a change on my code (not e2e test code),it seems that phantom was not taking the new changes or cleaning localStorage and SessionStorage. I think it could be cache but I am not sure.
I tried to add the next sentence on my protractor.config file in order to clean LocalStorage.
onPrepare: function () { browser.executeScript("return window.localStorage.clear();"); }
However , It didn't work , instead of that I got this error
var template = new Error(this.message); ^ UnknownError: {"errorMessage":"SecurityError: DOM Exception 18","request":{"headers":{"Accept-Encoding":"gzip,deflate","Connection":"Keep-Alive","Content-Length":"58","Content-Type":"application/json; charset=utf-8","Host":"localhost:9781","User-Agent":"Apac he-HttpClient/4.5.1 (Java/1.7.0_79)"},"httpVersion":"1.1","method":"POST","post":"{\"script\":\"return window.localStorage.clear();\",\"args\":[]}","url":"/execute","urlParsed":{"anchor":"","query":"","file":"execute","directory":"/","path":"/execute","relative ":"/execute","port":"","host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/execute","queryKey":{},"chunks":["execute"]},"urlOriginal":"/session/dc9ce280-e15f-11e5-911a-4b92e3de49f0/execute"}} Build info: version: '2.51.0', revision: '1af067d', time: '2016-02-05 19:15:17' Driver info: driver.version: unknown