title: Can a CSS property be used on an XPath locator to ensure an element is visible?
body: <p>I've got a block of divs which you can click to reveal content in an accordion style.</p>
  
  <p>I'm running through this block with selenium to open them all up and then ultimately capture a screenshot. However I'm unsure on how best to check that the accordion item has been displayed before moving on to the next one.</p>
  
  <p>At the moment my test runs through but the final screenshot shows some items still closed. My code:</p>
  
  <pre><code>detailsAccordion = self.ff.find_elements_by_class_name('accordion')
  index = 1
  for option in detailsAccordion:
      try:
          WebDriverWait(self.ff, 10).until(lambda driver : driver.find_element_by_xpath("//div[@class='accordionContainer']/div["+
              str(index) +"]/h3[1]")).click()
          # Need a WebDriverWait here for style='display: block;' on the current div
      except:
          print "Can't access div #" + unicode(index)
      index = index + 1
  </code></pre>
  
  <p>If I add a line like;</p>
  
  <pre><code>WebDriverWait(self.ff, 10).until(lambda driver : driver.find_element("//div[@class='accordionContainer']/div["+
                  str(index) +"][@style='display: block;']"))
  </code></pre>
  
  <p>I get my exception prints, so is it possible to add a requirement on the display property of each div?</p>