title: Using the Selenium Webdriver, how can I find all classes associated with a div?
body: <p>I have a div with multiple classes based on the permissions of the logged in user.</p>
  
  <p>When logged in:</p>
  
  <pre><code>&lt;div class="btn deleteButton canDelete"&gt;
  </code></pre>
  
  <p>When not logged in:</p>
  
  <pre><code>&lt;div class="btn deleteButton"&gt;
  </code></pre>
  
  <p>I need a way to determine whether or not a div which has the <code>deleteButton</code> class also has the <code>canDelete</code> class. </p>
  
  <p>I tried getting a list of all Elements with <code>deleteButton</code> and all Elements with <code>canDelete</code> and comparing them, but that doesn't work for two reasons:</p>
  
  <ol>
  <li><p>It's inefficient to loop through two potentially large lists rather than one. </p></li>
  <li><p>There are potentially other divs on the page with <code>canDelete</code>. This means that just comparing the two lists of Elements isn't effective.</p></li>
  </ol>