I'm trying to set up some Selenium test cases for a website I've built. The site was built using Zurb Foundation to support mobile, and one of the fields I'd like to test for desktop is hidden from the mobile view using the hide-for-medium-down class. This seems to hide it from the HTMLUnitDriver as well--the element is there when I use findElement, but when I use .getText() it's blank. Any suggestions on how to access that data with the HTMLUnitDriver? Is there another way to hide the divs from mobile that will make them accessible? Anyone else run into this issue?
The code is below. pageName return the H1, but when I try to get the text it's blank.
<div id="main-content" class="grid_10 landing large-10 medium-12 columns">
<div class="grid_10 alpha medium-12 hide-for-medium-down">
<h1>Title</h1>
<img src="/hr.jpg" alt="">
</div>
<div>
Code to retrieve element on page
WebElement pageName = driver.findElement(By.xpath("//div[@id='main-content']/div/h1"));
pageName.getText();