Class Name is the attribute of the HTML tag. This is generally noted by .(dot). You can locate web element by searching the class name. See the below syntax for Locating strategy for Class Name.
Syntax:
driver.findElement(By.className(“Name of the Class”))
Scenario with Example:
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class Locator_By_ID { public static void main(String[] args) { WebDriver driver= new ChromeDriver() ; driver.manage().window().maximize(); driver.get("https://www.testinglpoint.com"); login_button= driver.findElement(By.className("Name of the Class")) }