title: Need xpath locators for visible elements
body: <p>I'm trying to make a test for my site. Having troubles on some user form. The trick is, that the number of text fields in the form varies depending in user options (disabled ones are present in the code, but have a style &lt;<code>displayed: none;</code>> tag), so I'm trying to find more flexible approach than locating every element one-by-one and filling the forms with try/except blocks.</p>
  
  <p>I'm using an xpath locator</p>
  
  <p><code>text_fields = driver.find_elements_by_xpath("//div[@class='form-line']/div[@class='form-inputs']/input[@type='text' and not(ancestor::div[@style='display: none;'])]")</code> </p>
  
  <p>The trouble is that firebug locates only needed elements, but when I use it my selenium script, printing the list of <code>text_fields</code> gives me all the elements, even without a &lt;<code>displayed: none;</code>> tag</p>
  
  <p>How can I get only visible elements?</p>
  
  <p>PS Sorry for my bad English ^_^</p>