Table of Contents

Interface ILocalStorage

Namespace
OpenQA.Selenium.Html5
Assembly
WebDriver.dll

Represents the local storage for the site currently opened in the browser. Each site has its own separate storage area.

public interface ILocalStorage

Properties

Count

Gets the number of items in local storage.

int Count { get; }

Property Value

int

Methods

Clear()

Clears local storage.

void Clear()

GetItem(string)

Returns value of the local storage given a key.

string GetItem(string key)

Parameters

key string

key to for a local storage entry

Returns

string

Value of the local storage entry as string given a key.

KeySet()

Returns the set of keys associated with local storage.

ReadOnlyCollection<string> KeySet()

Returns

ReadOnlyCollection<string>

Returns the set of keys associated with local storage as HashSet<T>.

RemoveItem(string)

Removes key/value pair from local storage.

string RemoveItem(string key)

Parameters

key string

key to remove from storage

Returns

string

Value from local storage as string for the given key.

SetItem(string, string)

Adds key/value pair to local storage.

void SetItem(string key, string value)

Parameters

key string

storage key

value string

storage value