title: Using Selenium to determine the visibility of elements for Print media
body: <p>I would like to determine if particular elements on a page are visible when printed as controlled by CSS <code>@media</code> rules.</p>
  
  <p>Is there a way to do this with Selenium? </p>
  
  <p>I know there is the <a href="https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html#determining-if-an-element-is-displayed" rel="nofollow">isDisplayed</a> method, which takes the CSS into account, but there is nothing I can find to tell Selenium which media type to apply.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Or is there another way to test web pages to make sure the elements you want are printed (and those you don't aren't)?</p>
  
  <p>Update:</p>
  
  <p>For clarity, there are no plans to have a javascript print button. The users will print using the normal print functionality of the browser (Chrome, FF and IE). <code>@media</code> css rules will be used to control what is shown and hidden. <strong>I would like Selenium to pretend it is a printer instead of a screen, so I can test if certain elements will be visible in what would be the printed version of the page.</strong></p>