View Source Improve this doc

sessionStorage

Protocol bindings for all sessionStorage operations. This command is not part of the official Webdriver specification. Therefor it might not be supported in your browser.

Usage

1
2
browser.sessionStorage([method][,args]);

Parameters

Param Type Details
method
optional
String method for storage operation
args
optional
Object/String operation arguments

Example

sessionStorage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
it('should set/receive values from session storage', function () {
// get the storage item for the given key
var values = browser.sessionStorage('GET', someKey);
// get all key/value pairs of the storage
var storage = browser.sessionStorage();
// set the storage item for the given key
browser.sessionStorage('POST', {key: someKey, value: someValue});
// remove the storage item for the given key
browser.sessionStorage('DELETE', 'someKey');
// clear the storage
browser.sessionStorage('DELETE');
});