Member-only story
All The Selenium Locators For Automation
Selenium is one of the most popular tools for automation. It is very versatile because it can be used with many different web browsers as well as programming languages. The point of automation tools, specifically UI(user interface) automation tools, is to mimic how an actual user will use an application. So let us say the average user goes to Google and types something into the search bar and then presses the search button.
Now Selenium will need to mimic this behavior but does not know where anything is at on the page to click on or type too. So how do we tell Selenium where everything is located on a webpage? We must map the HTML web elements on the page to items in our code. We can view the elements of the web page by pressing F12 or by right-clicking the page and then selecting the “inspect” option and navigating to the elements tab. We will be using the different attributes for a web element to help us.
We then use Selenium’s locators to access the different parts of this page such as the buttons and input…