Clear local storage command doesn't work

Fixed Issue #11372324

Details

Author
Ron K.
Created
Mar 23, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
14.14393
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

OS:
Windows 10
Selenium Version:
3.3.1
Browser:
Microsoft Edge
Browser Version:
14.14393 (64Bit)

/session/:sessionId/local_storage (DELETE method) command should clear local storage data

Command failed with error:
09:40:16.620 INFO - Done: [new session: Capabilities [{rotatable=true, locationContextEnabled=true, webStorageEnabled=true, loggingPrefs=org.openqa.selenium.logging.LoggingPreferences@49ebe69, browserName=MicrosoftEdge, javascriptEnabled=true, handlesAlerts=true, requestOrigins={name=webdriverio, version=4.6.2, url=http://webdriver.io}}]]
09:40:16.995 INFO - Executing: [clear local storage])
09:40:16.995 WARN - Exception thrown
org.openqa.selenium.UnsupportedCommandException: driver (org.openqa.selenium.edge.EdgeDriver) does not support org.openqa.selenium.html5.WebStorage
Build info: version: '3.3.1’, revision: '5234b32’, time: ‘2017-03-10 09:04:52 -0800’
System info: host: 'WIN10-TEST’, ip: '172.16.1.4’, os.name: 'Windows 10’, os.arch: 'amd64’, os.version: '10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.handler.html5.Utils.convert(Utils.java:93)
at org.openqa.selenium.remote.server.handler.html5.Utils.getWebStorage(Utils.java:62)
at org.openqa.selenium.remote.server.handler.html5.ClearLocalStorage.call(ClearLocalStorage.java:31)
at org.openqa.selenium.remote.server.handler.html5.ClearLocalStorage.call(ClearLocalStorage.java:23)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Attachments

1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Steven K.”

    Changed Status to “Confirmed”

    Changed Title from “Webdriver - Clear local storage command doesn't work” to “Clear local storage command doesn't work”

  • Hi Ron,

    I see that this test was run against the Selenium Version: 3.3.1.  Can you try this with the 3.4.0 Selenium Version?   I highlighted some important updates in from the changelog.

    v3.4.0

    • Exposed new Interactions framework.
    • Updated bindings to properly use the W3C WebDriver Specification.

    https://raw.githubusercontent.com/SeleniumHQ/selenium/master/dotnet/CHANGELOG

    Let us know,

    The MS Edge Team

  • Microsoft Edge Team

    Changed Status from “Confirmed” to “Fixed”

  • Hi Ron,

    I used the OpenQA.Selenium.Edge and OpenQA.Selenium namespaces.  The EdgeDriver class inherits from the RemoteWebDriver class.  I was able to set and clear LocalStorage using the 3.4.0 Selenium Version on the Windows 10 14393.1066 version of Edge and with the following code (also attached the test html page):

    <code>
    using System;
    using System.Diagnostics;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using OpenQA.Selenium;
    using OpenQA.Selenium.Edge;
    using System.Threading;

    namespace WebDriverTestSuite
    {
        [TestClass]
        public class WebDriverReproTestSuite
        {
            EdgeDriver driver;
            EdgeOptions options;
            string webDriverPath;
            string baseURL;
            string port;
            string URLFilePath;
            string testURL;
            string searchFor;

            [TestInitialize]
            public void TestSetup()
            {
                webDriverPath = @"C:\bin\currMSWebDriver";
                baseURL = "http://127.0.0.1";
                port = ":8080";
                URLFilePath = "/storage.html";
                testURL = baseURL + port + URLFilePath;
                Debug.WriteLine("Time {0}", DateTime.Now);
                    // set options
                    options = new EdgeOptions();
                    //options.PageLoadStrategy = EdgePageLoadStrategy.Normal;
                    //options.SetLoggingPreference(LogType.Browser , LogLevel.All);
                    driver = new EdgeDriver(webDriverPath, options)
                    {
                        Url = testURL
                    };
            }
            [TestCleanup]
            public void Cleanup()
            {
                if (driver != null)
                {
                    driver.Quit();
                }
            }
            [TestMethod, TestCategory(“Regression”), TestCategory(“localstorage”)]
            public void clearStorage()
            {
                // check that storage is set in the F12/debugger before the 10s timer expires.
                Thread.Sleep(10000);
                driver.WebStorage.LocalStorage.Clear();
                // check that storage is cleared in the F12/debugger before the 15s timer expires.
                Thread.Sleep(15000);
            }
        }
    }

    </code>

    I will be closing this as fixed.

    Thank you for the submission and the support and let us know if you find anything else,

    The MS Edge Team

You need to sign in to your Microsoft account to add a comment.

Sign in