Showing posts with label Locators of Selenium WebDriver. Show all posts
Showing posts with label Locators of Selenium WebDriver. Show all posts

Tuesday, April 14, 2020

Introduction of Selenium Locators


Locator in simple term location of web element, which help 

Selenium to perform the operation on them.

Web elements should be text box, button, checkbox, radio button, links, drop down etc.

Selenium interact with web element using the locators.


Below are the common types of locators available in Selenium:

  • By ID
  • By Name
  • By Class Name
  • By Link Text
  • By Partial Link Text

  •     Absolute XPath
  •     AND Condition
  •     OR Condition
  •     Multiple Attributes

  •     Contains() Method
  •     Starts-with Method
  •     Text() Method
  •     Last() Method
  •     Position() Method

  •     Tag and ID
  •     Tag and Class
  •     Tag and Attribute
  •     Tag, Class & Attribute

  •      Starts-with (^)
  •      End-with ($)
  •      Contains (*)  

Monday, April 13, 2020

Selenium WebDriver Introduction

Selenium WebDriver is a web automation framework that allows you to execute your tests against different browsers, not just Firefox (unlike Selenium IDE).

  • WebDriver also enables you to use a programming language in creating your test scripts.
  • You can now use conditional operations like if-then-else or switch-case.
  • You can also perform looping like do-while.
  • Selenium WebDriver works by making calls to the browser & then performing testing or operations on the browser. 
  • Different browser drivers are used for making calls to different browsers.
  • Such as Chrome Driver, Gecko Driver, etc. The call is made by writing scripts.