title: Using Selenium Webdriver to obtain the active status of an element?
body: <p>We've got a new page we're automating, and some of the features coming through with the bootstrap template are causing some complications for automation.</p>
  
  <p>Traditionally, with a checkbox or radio button, we use a tag to identify it:</p>
  
  <pre><code>[FindsBy(How = How.CssSelector, Using = "body [autotag='prf_rd_1']")]
          private IWebElement myElement;
  </code></pre>
  
  <p>At which point you can use element.isSelected in Webdriver code to see if it's ticked.</p>
  
  <p>However, with bootstrap devs have changed to use a button which is either active or not active, eg:</p>
  
  <pre><code>&lt;button class="btn" autotag="prf_bt1" btn-radio="availabilityType.key" ng-model="model.availability.time" type="button"&gt; … &lt;/button&gt;
  
  &lt;button class="btn **active**" autotag="prf_bt1" btn-radio="availabilityType.key" ng-model="model.availability.time" type="button"&gt; … &lt;/button&gt;
  </code></pre>
  
  <p>(Hmm, not sure how to highly the word active in a code snippet, if anyone knows please feel free to edit)</p>
  
  <p>So, now we can't look for 'isSelected', as it doesn't work like a checkbox.  </p>
  
  <p>Does anyone have a code sample for determining whether a button has active class in its css, without using XPATH?  Currently we would use the CssSelector as above, and this way elements can move, text can change but as long as that autotag is still there, it's all good.  However, I'm unclear how I could do this AND look for other CSS (the class) at the same time to determine if it's active.</p>