SELENIUM BASICS:

  • What is Automation Testing - Advantages & Types of Tools
  • What is Selenium IDE, Selenium RC, Selenium WebDriver, Selenium Grid?
  • Selenium IDE, Firebug & Firepath Installation

  • SELENIUM WEBDRIVER:

  • Selenium WebDriver Architecture
  • Selenium Installation
  • Challenges and Limitations of Selenium
  • First Selenium WebDriver Script
  • Working with Firefox Browser
  • Solution - Failed To Launch Browser Using Selenium WebDriver
  • Working with Chrome Browser
  • Working with IE Browser
  • Difference Between FindElement & FindElements
  • Install Firebug, Fire path and other add on for Selenium
  • Locators in Selenium
  • Dynamic Xpath
  • Dynamic CSS
  • Handle drop-downs
  • How to work with file upload
  • Handle Alerts & Popups
  • Handle Multiple Windows
  • Mouse Hover event in Selenium
  • Right Click
  • Double Click
  • Drag and Drop
  • Capture Screenshots in Selenium
  • Parameterization
  • Synchronization
  • Implicit Wait, Explicit Wait and Fluent Wait in Selenium
  • Implicit Waits
  • Explicit WebDriver Waits
  • Fluent Wait In Selenium
  • Apache POI
  • How To Read Data From Excel File
  • How To Write Data In Excel File
  • Database Testing Using MSSQL
  • Database Testing Using MySQL
  • Database Testing Using DB2
  • Handle Ajax Call in Selenium
  • Listeners in Selenium
  • Handling JavaScript in Selenium
  • Stale Element Reference Exception in Selenium
  • Integrate Sikuli with Selenium
  • Headless Browser Testing 
  • Headless Browser Testing using HtmlUnitDriver
  • Headless Browser Testing using PhanthomJSDriver

  • TESTNG:

  • TestNG Installation
  • TestNG Complete Tutorial

  • REPORTS:

  • Extent Reports Introduction
  • Extent Reports Generation
  • Capturing Screenshots & Including In Extent Reports
  • Extent Reports Version 4

  • BUILD & CONTINUOUS INTEGRATION TOOLS:

  • ANT Build Tool - How To Download & Install
  • Maven Build Tool - How To Download & Install
  • Creating Maven Selenium Project
  • GIT Integration with Selenium
  • Jenkins - How To Download & Install
  • Jenkins - Executing TestNG Scripts
  • Jenkins - Generating Reports After Test Execution
  • Jenkins - Executing Maven Project
  • Create build and Execute build for nightly execution
  • Send Email report based on build Status
  • Selenium Continuous Integration with Jenkins [Selenium – Maven – Git – Jenkins] – Step By Step Guide

  • CROSS BROWSER TESTING:

  • Running Selenium Tests On BrowserStack
  • Kobiton - Mobile Testing Platform with Real Devices

  • MOBILE TESTING:

  • Mobile Testing Platform with Real Devices

  • AUTOMATION FRAMEWORKS:

  • What is Framework & Types of Framework
  • Page Object Model Design Pattern
  • Data Driven Framework
  • How to explain Test Automation Framework or Selenium Automation Framework Architecture In Interview

  • API Testing:

  • Learn API Testing
  • Postman Tutorial (API Testing with Postman)

  • INTERVIEW QUESTIONS:

  • Test Automation Framework Interview Questions
  • Selenium Interview Questions
  • TestNG Interview Questions
  • Java Interview Questions
  • Python Interview Questions
  • API Testing Interview Questions

  • SAMPLE RESUME:

  • Automation Tester Resume
  • Locators in Selenium Python

    In this tutorial, we will learn Locators in Selenium and how to find it when you are writing scripts using Python.

    Also, we discussed locators in Selenium when using Java

    What are the locators available in Selenium?

    Types of locators used in Selenium Python are as follows

    1. ID
    2. Name
    3. Class Name
    4. Tag Name
    5. Link Text
    6. Partial Link Text
    7. CSS Selector
    8. XPath

    Let’s discuss these Selenium WebDriver locators in detail.

    #1. Name

    The name attribute in the HTML code is used as a locator for identifying elements. There may be multiple elements having the same value of name attribute in that case the first matching element will be identified. NoSuchElementException is thrown if there is no matching element with the name we are looking for.

    Syntax: find_element_by_name (“software”)

    Click this link for a detailed explanation of Name Locator

    #2. Id

    The id attribute in the HTML code is used as a locator for identifying elements. The ids are generally unique for an element. NoSuchElementException is thrown if there is no matching element with the id we are looking for.

    Syntax: find_element_by_id (“test”)

    Click this link for a detailed explanation of ID Locator

    #3. Class name

    The class name attribute in the HTML code is used as a locator for identifying elements. There may be multiple elements having the same value of class name attribute in that case the first matching element will be identified. NoSuchElementException is thrown if there is no matching element with the class name we are looking for.

    Syntax: find_element_by_class_name (“test-auto”)

    Click this link for a detailed explanation of Class Name Locator

    #4. Tag Name

    The Tag Name in the HTML code is used as a locator for identifying elements. There may be multiple elements having the same Tag Name in that case the first matching element will be identified. NoSuchElementException is thrown if there is no matching element with the Tag Name we are looking for. Tag Name locator in Selenium is generally useful for getting the content enclosed in the tag.

    Syntax: find_element_by_tag_name (“input”)

    Click this link for a detailed explanation of Tag Name Locator

    #5. Link Text

    The text enclosed within an anchor tag is used to identify a link or hyperlink. There may be multiple elements having the same link text, in that case, the first matching element will be identified. NoSuchElementException is thrown if there is no matching element with the link text we are looking for.

    Syntax: find_element_by_link_text (“Selenium Python”)

    Click this link for a detailed explanation of Link Text Locator

    #6. Partial Link Text

    The partial text enclosed within an anchor tag is used to identify a link or hyperlink. . There may be multiple elements having the same partial link text, in that case, the first matching element will be identified. NoSuchElementException is thrown if there is no matching element with the partial link text we are looking for.

    Syntax: find_element_by_partial_link_text (“Selenium”)

    Click this link for a detailed explanation of Partial Link Text Locator

    #7. CSS Locator in Selenium

    The element is identified with the CSS created with the help of HTML attribute, value, or tagName. NoSuchElementException is thrown if there is no matching element with the CSS we are looking for. A customized CSS expression can be built by following some of the below rules:

    a) With the help of id and Tag Name. First, we need to specify the Tag Name followed by (#) then the id. Also, Tag Name is optional and can be omitted from the CSS expression.

    Syntax: find_element_by_css_selector (“input#txt”)

    b) With the help of class name and Tag Name. First, we need to specify the Tag Name followed by (.) then the class name. Also, Tag Name is optional and can be omitted from the CSS expression.

    Syntax: find_element_by_css_selector (“input.txt-bx”)

    c) With the help of Tag Name and any attribute with its values. First, we need to specify the Tag Name followed by the attribute with its value enclosed in ([]).

    Syntax: find_element_by_css_selector (“a [alt=’title’]”)

    d) To identify a sibling element, we need to specify the nth-child (n) of the parent in a CSS expression. Suppose to navigate to the second column in a table, for that we have to use the nth-child concept.

    Syntax: find_element_by_css_selector (“tr td: nth-child (2)”)

    Click this link for a detailed explanation of CSS Selector Locator

    #8. XPath

    The element is identified with the XPath created with the help of HTML attribute, value, and tagName. NoSuchElementException is thrown if there is no matching element with the XPath we are looking for. Xpath is of two types absolute and relative. For absolute XPath, we have to traverse from root to the element. However, for relative XPath, we can start from any position in DOM. An XPath expression should follow a particular rule- // tagname [@attribute=’value’]. The Tag Name is optional. If it is omitted, the expression should //*[@attribute=’value’].

    Syntax: find_element_by_xpath (“//a [@alt=’title’]”)

    Click this link for a detailed explanation of XPath Locator

    Locators in Selenium WebDriver

    Get our latest blog posts delivered to your inbox

    Subscribe and get popular blog posts about software testing industry.

    Rajkumar

    Leave a Comment

    Share via
    Copy link
    Powered by Social Snap