title: C# Selenium: Use WebDriver To Retrieve List of All WebElements on Webpage?
body: <p>Thanks for reading this!</p>
  
  <p><em>Problem:</em>
  I need to cycle through all the elements on a webpage, using C# and Selenium.  The goal is to discover the attributes for an existing web page without knowing the Ids or other attributes.  Put another way, how do you perform FindElements to return a list of all the IWebElements on a page, not just a specific type or id mask?</p>
  
  <p><em>So far:</em>
  I found a javascript command to print out all the attributes of a given element, which can be called from C# on each element as its found.  The javascript command does not need to know the type of the element.</p>
  
  <p><em>Need to Solve:</em>
  How does one use Selenium to retrieve a list of all the IWebElements on a web page?</p>
  
  <p><em>Overall Goal:</em>
  In the past, I've used other tools to create a wrapper object for all the elements of the webpage I would potentially need to interact with while writing test automation.  (For those who've used WatiN, this is an adapter written automatically using the collection of all web controls on the page.)</p>