lookupCookie

The following locator locates and returns a given cookie on the document.

			
// Looks up a given cookie
//
//
PageBot.prototype.locateElementByCookie = function(text, inDocument) {
 
    var cookieMatch = new RegExp(";?" + text + "\=([^;]+)").exec(inDocument.cookie);
    if (null != cookieMatch) {        
        var retObj = new Object();
        retObj.value = retObj.textContent = cookieMatch[1];
        retObj.type = "";
        return retObj; 
    }
    return null;
};
			

Example:

assertValue cookie=prefLanguage en-US

This examples checks that the cookie named 'prefLanguage' has the value 'en-US'.

File: 

AttachmentSize
Plain text icon lookupCookie.txt413 bytes

Type: 

User-Extension