title: Read-Only attribute using Selenium
body: <p>Verifying a Read-only attribute using Selenium.</p>
  
  <p><code>.getAttribute("readonly")</code> returns "true" if it is Read-only object and returns "null" if it is not a Read-only object</p>
  
  <p>How to handle this? Is there any try catch required here?</p>
  
  <pre><code>String State = driver.findElement(By.id("Organisationname")).getAttribute("readonly"); 
  </code></pre>
  
  <p>This returns 'true' if textbox is Readonly and 'null' if it is not Readonly
    I am trying below if else condition.But while moving to else statement InvocationTargetException is coming up</p>
  
  <p>Is it becuase of return types true and null</p>
  
  <pre><code>                             if(State .contains("true")){
                                   System.out.println("readonly");
                               }else{
                                   System.out.println("not readonly");
                               }
  </code></pre>