fbpx
Mathikere, Bangalore

Email Us

info@automationtestingtool.com

Call Us

+91 98 4583 4306

New Location @

Koramangala

Join Our Successful
Training Institute

  1. Free DemoVideo Request

Selenium Locators

Selenium Locators –How to Identify Web Elements in Selenium?

Locators – It is a strategy to identify the Web Elements on the application under test. In WebDriver this is possible through two methods exposed by every language bindings called as “findElement” and “findElements”. These methods use the “By” Locator/Object to identify each and every WebElement, following are the different locator strategies

 

Following DOM tag is used for illustrating examples

ID
EX-  driver.findelement(By.id(“login-email”));

ClassName – An attribute of the DOM element
Ex –  driver.findelement(By.classname(“login-email-reg-field__input”));

Tag Name – use the tag name of the DOM element
Ex – driver.findelement(By.tagName(“input”));

Name
Ex – driver.findelement(By.name(“session_key”));

LinkText
Ex – driver.findelement(By.linkText(“Forgot Password”));

PartialLink Text
Ex – driver.findelement(By.partialLinkText(“Forgot”));

CSS
Ex –  driver.findelement(By.cssSelector(“#reg-lastname”));

XPath
Ex – driver.findelement(By.xpath(“//input[@id=”reg-lastname”]));

Placement

Go into the places only locals are familiar with. Visit little known hideouts and avenues that open the mind into what being a local is all about.

On the Fly Examples

Go into the places only locals are familiar with. Visit little known hideouts and avenues that open the mind into what being a local is all about.

Student Support

Go into the places only locals are familiar with. Visit little known hideouts and avenues that open the mind into what being a local is all about.

"What I love about these tours is that the guides are not afraid to get off the beaten track and show us the real city. This is an I will definitely come back to"
Alene Elvine
HR Manager
“The guide was everything I hoped for, and more. BikeTour really makes a difference, I would have never discovered the beautiful places we stopped for"
Jonas Gerber
Designer

Register for a free demo

Join our Successful
Training Institute

BikeTour offers the most interactive activity you can experience in urban and natural surroundings. Find out how the real city comes alive when you are guided by the right person

our placement partners