I wanted to locate a element of a web page using class name in Selenium. This is the web element that I tried:
<button class="signup-button b green">Get Started!</button>
When I try this way, I was unable to locate the button;
driver.findElement(By.className("signup-button")).click();
But, using css selector like below, it was working;
driver.findElement(By.cssSelector("button.signup-button")).click();
What is the reason for that sometimes working and other times not working?