title: Selenium how to access two controls of same css class
body: <p>I am doing testing using selenium ide.
  My objective is to verify the following</p>
  
  <p>1) Max and Min length property of text boxes.
  2) Verify the texts of the labels</p>
  
  <p>My html code is as below:</p>
  
  <pre><code>&lt;div class="control-group"&gt;
                                  &lt;label class="control-label" for="input01"&gt;Email&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;input name="data[Salon][username]" class="span4" id="username" placeholder="Username or Email" type="text"/&gt;                                   
                                      &lt;/div&gt;
                              &lt;/div&gt;
  
                              &lt;div class="control-group"&gt;
                                  &lt;label class="control-label" for="input01"&gt;Password&lt;/label&gt;
                                      &lt;div class="controls"&gt;
                                          &lt;input name="data[Salon][password]" class="span4" id="password" placeholder="Required" type="password"/&gt;                                                                    
  &lt;/div&gt;
  </code></pre>
  
  <p>But in the above I am facing following problems:</p>
  
  <p>a) I have problem in accessing the labels for assertText or assertElementPresent since they are having same class name.</p>
  
  <p>b) I don't know how verify the Max and Min length property of the Text boxes.</p>
  
  <p>And please note that when I am trying to use </p>
  
  <pre><code>document.getElementsByClassName("control-label")
  
  I am getting the following error:
  
  [error] locator not found: document.getElementsByClassName("control-lable"), error = TypeError: e.scrollIntoView is not a function
  </code></pre>