| ID | driver.findElement(By.Id("Login")); |
| Name | driver.findElement(By.Name("Login")); |
| ClassName | driver.findElement(By.ClassName("Login")); |
| LinkText | driver.findElement(By.LinkText("Login")); |
| PartialLinkText | driver.findElement(By.PartialLinkText("Login")); |
| TagName | driver.findElement(By.TagName("Login")); |
| XPath | driver.findElement(By.XPath("Login")); |
findElement()
the command used to identify a web element in the web page.
- This command is used to fetch a single element on the web page
- It will return the object of the first matching element
- It will throw NoSuchElementException when there is no element
driver.findElement(By.xpath("//*[@Value='Yes']")).click();Ex:
findElements()
the command used to identify a list of web elements in the web page.
No comments:
Post a Comment