Selenium Locators
Table | Example |
---|---|
ID | FindElement(By.Id("user")) |
Name | FindElement(By.Name("username")) |
Link Text | FindElement(By.LinkText("Login")) |
Partial Link Text | FindElement(By.PartialLinkText("Next")) |
Xpath | FindElement(By.Xpath("//div[@id='login']/input")) |
Tag Name | FindElement(By.TagName("body")) |
Class Name | FindElement(By.ClassName("table")) ... |