Selenium webdriver uses 8 locators to find the elements on web page.
-
id
-
Name
-
Linktext
-
Partial Linktext
-
Tag Name
-
Class name
-
CssXpath
Example to identify element by ID:
WebElement Ele = driver.findElement(By.id("toolbar"));
Rest you may type . after By and figure out.