Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

What are the Element Locators are available for Browser?

Category: Selenium WebDriver
  • ID – driver.findElement(By.id(“IdName”))
  • Name – driver.findElement(By.name(“Name”))
  • Class Name – driver.findElement(By.className(“Element Class”))
  • Tag Name – driver.findElement(By.tagName(“HTML Tag Name”))
  • Link Text – driver.findElement(By.linkText(“LinkText”))
  • Partial Link Text – driver.findElement(By.partialLinkText(“partialLinkText”))
  • CSS Selector – driver.findElement(By.cssSelector(“value”))
  • XPath – driver.findElement(By.xpath(“XPath”))

driver – Object/Instance of WebDriver
findElement – WebDriver method
By – Pre-defined Class in Selenium
id – Element locater/attribute
IdName – Locator value

Leave a Reply

Your email address will not be published. Required fields are marked *