21. What are Locators ?



First lets understand what are the UI elements using the following example:

Example#1 - Suppose we've to automate a test, where the User have to log in to Facebook

Steps to Log In to Facebook application:
  1. Browse www.facebook.com in any browser
  2. In 'Facebook' Log In page, enter your email id into the Username text box.
  3. Enter your Facebook password into the Password text box. 
  4. Click on 'Log In' button.
In the above example, Username text box, Password text box and Log In text box are the UI elements to be identified by the automation tool.

Example#2 - Suppose we've to automate a test, where the User have to search for 'Selenium143' in Google.

Steps to search for 'Selenium143' in Google:
  1. Browser www.Google.com in any browser
  2. In 'Google' page, enter text 'Selenium143' into the 'Search' text box
  3. Click on 'Google Search' Button
In the above example 'Search' text box and 'Google Search' button are the UI elements to be identified by the automation tool.

So now you have understood how to identify the UI elements required by our automation tools manually on any page. But how can Selenium Automation Tool identify the UI elements for automating the tests. So the simple answer is by using the Locators. Lets find out what actually the locators are:

Identifying an UI element on the application screen is an important feature for any automation tool. Locators allows the Selenium Automation tool to find UI elements on a page that can be used in our automation tests.

i.e. The Selenium Tool uses Locators to find and match the elements on your page that it needs to interact with while running the automation scripts.

Now lets go forward to find out the different types of Locators that help the Selenium Tool in identifying the UI elements on any page (Explained in the next post) .

Please comment below to feedback or ask questions.

Using Different Types of Locators will be explained in the next post.




No comments:

Post a Comment

Followers

Labels