Using getAttribute to get the class name of a webelement in Native context
<p>Went through the java docs of <a href="https://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/WebElement.html#getAttribute(java.lang.String)" rel="nofollow">getAttribute</a>. Couldn't understand the point mentioned as : </p>

<blockquote>
  <p>Finally, the following commonly mis-capitalized attribute/property
  names are evaluated as expected: "class" "readonly"</p>
</blockquote>

<p>Could someone confirm if <code>webElement.getAttribute("class")</code> shall return the class name of the element or not?</p>

<p><strong>Edit</strong> : On trying this myself</p>

<pre><code>System.out.println("element " + webElement.getAttribute("class")); 
</code></pre>

<p>I am getting </p>

<blockquote>
  <p>org.openqa.selenium.NoSuchElementException</p>
</blockquote>

<p><strong>Note</strong> : The element does exist on the screen as I can perform actions successfully on the element :</p>

<pre><code>webElement.click(); //runs successfully
</code></pre>

<p>Code:</p>

<pre><code>WebElement webElement = &lt;findElement using some locator strategy&gt;; 
System.out.println("element " + webElement.getAttribute("class"));
</code></pre>