I admit it's a bit of a weird case, but I'm not actually testing the web-page itself, I'm testing the AppServer that displays the web page - the web page being the App Server's self diagnostic page.
The page I'm accessing has about 6 expandable sections in it, each section has a number of Status entries (75 in total at the moment). I'm checking that all Status entries are 'good', and if any aren't I want to get the content out of them. As all the Status entries load themselves during the page load, and they are all accessible by getting Elements with a specific class, so I can access all Statuses without caring if they are displayed or not, and without having to navigate through the page to get them to be displayed.
e.g.
List<WebElement> statusElements = driver.getAllByClassName(status);
List<WebElement> goodElements = driver.getAllByClassName(good);
//Removing good elements from the list of all statuses
statusElements.removeAll(goodElements);
for (WebElement nonGoodElem : statusElements) {
// The 'heading' for the status is in am h3 within the status div
String heading = nonGoodElem.findElement(By.xpath(".//h3")).getAttribute("innerHTML");
log("non-good Status = " + heading);
}
<div class="status good">
<h3>PHP</h3>
<p> You have PHP version 5.3.2-1ubuntu4.17.</p>
</div>
<div class="status bad">
<h3>Clean URLs</h3>
<p> Request rewriting does not appear to be working correctly. Please verify your web server's request rewriting configuration and try again. For Apache, ensure the mod_rewrite module is enabled.</p>
</div>
(Fingers crossed the formatting works OK for this!)