hidePageElements

An extension to hide page elements:

 

//Function to hide individual page elements by ID, can be set to True or False
Selenium.prototype.doHideElement = function(divID,bool) {
   
    if (bool == 'True'){
    var divElement = selenium.browserbot.getCurrentWindow().document.getElementById(divID);
    divElement.style.display="none";

    }
    else if (bool == 'False'){
    var divElement = selenium.browserbot.getCurrentWindow().document.getElementById(divID);
    divElement.style.display="block";

    }
}

//Function to access Jquery
function jQuery (selector)
{
    return selenium.browserbot.getUserWindow().jQuery(selector);
}

 

//Function to hide all div elements on the page except the one you select
Selenium.prototype.doHideAllDivButOne = function(divId) {
     
     jQuery("h1").css('visibility', 'hidden');
     jQuery("div").css('visibility', 'hidden');
     jQuery("#"+divId).find('*').css('visibility', 'visible');
   

}

Selenium.prototype.doUnhideAll = function() {
     
     jQuery("h1").css('visibility', 'visible');
     jQuery("div").css('visibility', 'visible');

File: 

Type: 

User-Extension