-
Notifications
You must be signed in to change notification settings - Fork 21
/
cookies-get.js
37 lines (34 loc) · 900 Bytes
/
cookies-get.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/**
* Cookies-Get
*
* Get all cookies and return in currentCookies
*
* Returns:
*
* currentCookies : Array of all cookies currently defined in a session
*
* Notes
*
* https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript
*
* Disclaimer
* This Custom Action is provided "AS IS". It is for instructional purposes only and is not officially supported by Testim
*
* Base Step
* Custom Action
*
* Installation
* Create a new "Custom Action" named "Cookies-Get"
* Set the new custom action's function body to this javascript
* Exit the step editor
* Save the test
* Bob's your uncle
*
**/
var cookies = document.cookie.split(";");
for (var i = 0; i < cookies.length; i++)
{
var spcook = cookies[i].split("=");
console.log(spcook);
}
exportsTest.currentCookies = cookies;