title: Compound class names not permitted error Webdriver
body: <p>I am getting the following error: </p>
  
  <blockquote>
    <p>"Compound class names not permitted"</p>
  </blockquote>
  
  <p>While trying to access web element where-in the element's class name have spaces in between. The page source for the web element is as below.</p>
  
  <pre><code>driver.findElement(By.className("alert alert-success"));
  </code></pre>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="alert alert-success" alert-dismissable"="" id="58417" style="display: none;"&gt;
     &lt;button type="button" class="close hide-panel close-icon-58417" data-dismiss="alert" aria-hidden="true" style="display: inline-block;"&gt;×&lt;/button&gt;&lt;span id="caret-58417" class="notification-caret caret-58417"&gt;&lt;/span&gt;
     &lt;div class="hide-panel close-icon-58417" id="58417" style="display: block;"&gt;
        &lt;span class="glyphicon glyphicon-ok-sign"&gt;&lt;/span&gt;&lt;strong&gt;Success&lt;/strong&gt; KeyLinks Updated Successfully
        &lt;div class="notification-panel-body panel-body-58417"&gt;REST Invocation Success&lt;/div&gt;
     &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried to find the element by CSS path as below. But the element is not searchable with this.</p>
  
  <pre><code>driver.findElement(By.cssSelector(".alert alert-success"));
  </code></pre>
  
  <p>This was the workaround <a href="https://stackoverflow.com/questions/15699900/compound-class-names-are-not-supported-error-in-webdriver#">given in the Link</a> but still <em>no success</em>. your help will be much appreciated. </p>