There are various locator types :
- C# Locator
- Java Locator
- XPath Locator
- Ruby Locator
We can Locate element by various way like by ID, Type, Name, CSS Class, etc..
Here are examples of locator strings which are useful in C# code to get value or perform any action on that element :
Now to locate an element first you need to download and install FireFox Element Locator Add-on.
Selenium Tool : Download and Install FireFox Element Locator Add-on.
After installing FireFox Element Locator Add-on you need to do just right click on any element in FireFox Web browser, after clicking on element you can see the context menu, In context menu you can see various locator type like C# Locator, Java Locator, XPath Locator, Ruby Locator, etc.
On clicking on that particular menu you can see list of valid locator string with green color right tick mark, by clicking on that particular locator string it will copy that string in your clipboard and you can paste at any place where you want to use this element locator string.
|(To view original size image , click on image)|
Full Video :