title: Selenium Webdriver - how to check if attribute is missing and then proceed
body: <p>The "disabled" attribute for the element is only present when the button is enabled. For a disabled state the attribute <b>disabled="disabled"</b> is not shown in the HTMl (the attribute itself and not the value)</p>
  
  <p>How can I check for attribute and if its not there then proceed</p>
  
  <p>I tried this</p>
  
  <pre><code>driver.findElement(By.id("button")).getAttr‌​ibute("disabled") != "disabled"
  </code></pre>
  
  <p>but when the button is in disabled state this line fails as there is no "disabled" attribute</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;td&gt;
  &lt;input id="ReportViewer1_ctl06_ctl00_Next_ctl01_ctl00" type="image" 
  style="border-style: none; height: 16px; width: 16px; border-width: 0px;     
  cursor: default;" alt="Next Page" src="/xxxx Reserved.
  ReportViewerWebControl.axd?OpType=Resource&amp;Version=
  0.0.30319.1&amp;Name=Microsoft.Reporting.WebForms.Icons.NextPageDisabled.gif" 
  title="Next Page" disabled="disabled"
  name="ReportViewer1$ctl06$ctl00$Next$ctl01$ctl00"&gt;
  </code></pre>