title: Selenium Webdriver: Cant find element by classname
body: <p>I am currently struggling with Selenium to select an element by its class name. 
  The Website I'm using is:</p>
  
  <pre><code>http://demo.guru99.com/test/login.html
  </code></pre>
  
  <pre><code>&lt;div class="col-xs-12 col-sm-6"&gt;
              &lt;form action="success.html" method="post" id="login_form" class="box"&gt;
                  &lt;h3 class="page-subheading"&gt;Already registered?&lt;/h3&gt;
                  &lt;div class="form_content clearfix"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="email"&gt;Email address&lt;/label&gt;
                          &lt;input class="is_required validate account_input form-control" data-validate="isEmail" type="text" id="email" name="email" value=""&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;label for="passwd"&gt;Password&lt;/label&gt;
                          &lt;span&gt;&lt;input class="is_required validate account_input form-control" type="password" data-validate="isPasswd" id="passwd" name="passwd" value=""&gt;&lt;/span&gt;
                      &lt;/div&gt;
                      &lt;p class="lost_password form-group"&gt;&lt;a href="#" title="Recover your forgotten password" rel="nofollow"&gt;Forgot your password?&lt;/a&gt;&lt;/p&gt;
                      &lt;p class="submit"&gt;
                          &lt;input type="hidden" class="hidden" name="back" value="my-account"&gt;                     &lt;button type="submit" id="SubmitLogin" name="SubmitLogin" class="button btn btn-default button-medium"&gt;
                              &lt;span&gt;
                                  &lt;i class="icon-lock left"&gt;&lt;/i&gt;
                                  Sign in
                              &lt;/span&gt;
                          &lt;/button&gt;
                      &lt;/p&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>I figured out how to select the element by id but whenever I try to select it by classname I get an element not found exception. I don't really understand how this works as I tried multiple websites without success. In this example the element has multiple classes but on some websites this method even fails when there is only one class. On this website selecting it by only one class works but I have read that this isn't a good method as you could be selecting multiple elements by mistake.</p>
  
  <pre><code>IWebElement search = driver.FindElement(By.ClassName("account_input"));
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>driver = new ChromeDriver();          
  driver.Url = "http://demo.guru99.com/test/login.html";
  driver.Navigate();
  IWebElement search = driver.FindElement(By.ClassName("is_required.validate.account_input.form-control"));
  search.SendKeys("test");
  </code></pre>
  
  <p>In this example selecting element by Id using the By.Id("first_name") method doesn't work either:</p>
  
  <pre><code>&lt;span&gt;
        &lt;label class="first_name_label form_label_text"&gt;&lt;/label&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;
                  &lt;div class="form-item icon"&gt;
                    &lt;input value="" data-error="An error has occured." id="first_name" type="text" name="first_name" class="form_item  is_required" placeholder="First Name"&gt;
                    &lt;i style="color:rgba(70,75,106,0.5)" class="vs icon-user"&gt;&lt;/i&gt;                &lt;/div&gt;
                                  &lt;div class="form-item icon"&gt;
                    &lt;input value="" data-error="An error has occured." id="last_name" type="text" name="last_name" class="form_item  is_required" placeholder="Last Name"&gt;
                    &lt;i style="color:rgba(70,75,106,0.5)" class="vs icon-user"&gt;&lt;/i&gt;                &lt;/div&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>What am I doing wrong? Help would be greatly appreciated</p>