title: How to get all elements into list or string with Selenium using C#?
body: <p>I've tried using WebElement (and IWebElement) and string lists, but I keep getting errors. How can I get a list or strings of all the elements text by classname? I have all Selenium references. Do I need some java.util dll? </p>
  
  <p>Should I implement a foreach loop?</p>
  
  <pre><code>IList&lt;IWebElement&gt; all = new IList&lt;IWebElement&gt;();
  all = driver.FindElements(By.ClassName("comments")).Text;
  </code></pre>
  
  <p>Error: Cannot create an instance of the abstract class or interface 'System.Collections.Generic.IList'</p>
  
  <p>Error: 'System.Collections.ObjectModel.ReadOnlyCollection' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type</p>