Class Name Locator:
Class Name locator when matches the values specified in the attribute name “class”, retrieves the web-element.
Syntax:
findElement(By.className("Element Class"))
Open Mozilla Firefox and navigate to the Facebook application.
Open Firebug and inspect the Email input box. Take a note of its Class.
Follow the below screenshot to do so.

Use the below:
<td>
<input id="email" class="inputtext" type="email" tabindex="1" value="" name="email">
</td>
Value to be added in the By.className method:
findElement(By.className("inputtext"))
Script:
package seleniumTutorial;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Locators {
public static void main (String [] args){
WebDriver driver = new FirefoxDriver();
driver.get("https://www.facebook.com/");
driver.findElement(By.className("inputtext")).sendKeys("Software Testing Material");
}}