As you said, you can use the loactor ID for doing it:
See the screenshot here:
Here you can get the ID for the Login button and use it to test the login button.
E.g., I am using the login button to click like this :
driver.get("https://www.facebook.com");//Opening facebook after entering the username and password
driver.findElement(By.id("u_0_2")).click());//click the button
Hope this helps.