We may earn an affiliate commission when you visit our partners.
Sanjay Kumar

A Course to improve Knowledge & Productivity. This course has covered everything what I teach in Live SelectorsHub Training.

Topics covered in this course-

Read more

A Course to improve Knowledge & Productivity. This course has covered everything what I teach in Live SelectorsHub Training.

Topics covered in this course-

  • XPath concepts and Writing XPath from basic to advance.

  • Writing all kinds of XPath like XPath relative to other element, Relative XPath to Parent, index based xpath, XPath with attribute & text and absolute xpath.

  • Detailed explanation about important functions of XPath like text(), . dot, normalize-space(), not(), . =

  • Difference between //* and //tagname

  • Importance concepts about web like pseudo elements, comment, what is possible and what is not possible for web elements

  • XPath 1.0 and XPath 2.0

  • Shadow DOM, iframe, SVG, different technique to write xpath.

  • How to automate and handle more complex scenarios like shadow dom inside iframe, iframe inside shadow dom, multiple shadow dom inside iframe etc.

  • How to automate closed shadow dom

  • Handling all kinds of web elements like dynamic, invisible dropdown and submenu etc.

  • How to handle spin loader

  • cssSelector, JS Path, jQuery

  • Full training on SelectorsHub,

  • How to write automation script smartly,

  • Full training on TestCase Studio.

  • How to complete manual testing without wasting much time and smartly.

  • Bug reproducing techniques and a lot more.

  • Interview preparation and questions on XPath & Selectors.

  • After each class, practice questions and exercise will be shared. We will also discuss the exercise questions.

  • Writing Axes Based XPath, XPath for Web Tables etc will be taught..

Enroll now

What's inside

Syllabus

Here I have explained what is this course about and what all will you learn.
Agenda and Web Terminology
Student will learn all about XPath from very basic to very advance. You will be able to write All kinds of complex XPath & will have deep understanding of XPath like how it work & all it's functions
Read more
What is XPath, it's Importance & Types.
  1. Comparison between different platform to verify xpath like DevTools (ctrl+f), console and SelectorsHub

  2. Realtime example to prove the concept

  1. Realtime example how to write and verify XPath in SelectorsHub

  2. Learn all the smart editor features of SelectorsHub

Get your SelectorsHub Pro Free Account from Below Link-

https://selectorshub.com/how-to-get-free-trial-account-without-entering-card-details/

Write XPath with different XPath Formulas and Functions

Attribute Preference while writing XPath

  • Predefined Stable Attribute

  • id

  • Placeholder

  • Title

  • Name

  • Value

  • Aria-label

  • Alt

  • For

  • data-label

XPath 1.0

  • All the XPath functions which we have learned so far and

  • //tagname[starts-with(@attr, ”value”)]

  • //tagname[starts-with(text(), ”value”)]

All the modern browsers supports only XPath 1.0 functions so in our web automation we will be using the XPath 1.0

ends-with is part of xpath 2.0 which browser doesn’t support

//tagname[ends-with(@attr,”value”)]


Note- In some framework you might see people using xpath 2.0 functions but they can't use it directly for sure they must be using some library in the background or must have written some wrapper.

  • Difference between / and //

  • Difference between text(), . (dot) and normalize-space()

  • How to write XPath to get all elements which has the text

  • How to write Relative XPath with Parent without using Axes methods of XPath

  • Difference between //* and //tagname and which one should we use

    Important Info-

    • Pseudo Element

    • Comment

    • Input Box where we can’t enter value

    • Style Element

    • Script Tag

    • . DOM, complete document

    • // Invalid XPath

    • /. DOM, complete document

    • /* html node

  • How to write case insensitive XPath

  • Learn to write XPath based on attribute presence.

  • How to write XPath based not matching value

  • What is the difference between != and not() function

In this lecture, you will learn to write unique relative xpath to other element using axes based functions of xpath.

Formula
xpath/axesMethod::tagname

Axes Methods

  • parent::

  • ancestor::

  • following-sibling::

  • preceding-sibling::

  • following::

  • descendant

  • ..

  • child::

In this lecture, you will learn to write-

  • XPath for Web Tables

  • XPath for all the columns values with respect to header

  • XPath for last row

  • XPath for last column value

Student will learn all about cssSelector from very basic to very advance. You will also learn about Shadow DOM, iframes & SVG elements and different complex scenarios.
  • What is cssSelector?

    • cssSelector is the address of an element.

    • There are multiple ways to write an cssSelector.

  • Type of cssSelector

    There is nothing like types. It is depends on our writing pattern.

  • CSS vs cssSelector

  • XPath vs cssSelector


Write cssSelector using cssSelector functions

  • #idValue

  • .classValue

  • tagName[attributeName=’attributeValue’]

  • tagName[attributeName$=’ending value of attributeValue’]

  • tagName[attributeName^=’starting value of attributeValue’]

  • tagName[attributeName*=’substring of attributeValue’]

  • Case Insensitive i

    $ ends with

    ^ starts with

    * contains

In this lecture you will learn to write

  • Unique Relative cssSelector with Parents

  • Relative cssSelector using axes types functions

  • More useful cssSelector functions like > , ~ , + etc.

    useful cssSelector Functions


    • The (space) combinator selects nodes that are descendants of the first element.

    • The > combinator selects nodes that are direct children of the first element.

    • The ~ combinator selects siblings. This means that the second element follows the first (though not necessarily immediately), and both share the same parent.

    • The + combinator selects adjacent siblings. This means that the second element directly follows the first, and both share the same parent.

    • :first-child, :last-child, :nth-child(), :nth-last-child(), :first-of-type, :last-of-type

      The :first-of-type represents the first element of its type among a group of sibling.
      The :last-of-type represents the last element of its type among a group of sibling elements.

Other useful Selectors in web automation apart from xpath & cssSelector

SVG Elements

  • Doesn’t support standard XPath Format

  • //svg - invalid xpath

  • Supported svg XPath syntax-
    //*[local-name()='svg']
    //*[name()='svg']

  • All other selectors supports SVG as standard

iframe Elements and iframe

  1. iframe (same origin iframe)

  2. Nested iframe

  3. Cross Origin iframe

Shadow DOM Elements

  1. Shadow DOM (open)

  2. Nested Shadow DOM (open)

  3. Closed Shadow DOM

  4. Shadow DOM inside iframe

  5. iframe inside shadow dom

  6. nested shadow DOM inside iframe

  7. closed shadow DOM inside iframe

  8. SVG elements inside Shadow DOM

Note: Shadow DOM doesn’t support XPath. All other selectors can be used to access shadow DOM elements.


Student will learn all about SelectorsHub & how to make its best use to save more time. You will also learn automating Shadow DOM, iframes and SVG elements without wasting any time.
  • What is SelectorsHub

  • How to install it

  • How to use it

SelectorsHub Features-

  • Smart Editor

  • Error Handling

  • Save selectors

  • Case Insensitive Selector

  • Generate Selector with desired attribute

  • Generate Selector with command

  • Generate Selector/Code for multiple elements

  • Generate Selector with “ double quotes

  • Customise UI

  • Reset settings to Default


More innovative and time saver features of SelectorsHub

  • Generate Selector with command

  • Generate Selector/Code for multiple elements

  • Automatically generate the locators page for POM framework

  • Generate Selector with “ double quotes. Very helpful for Playwright users.

  • Personalise SelectorsHub UI

  • Reset settings to Default

How to inspect Dynamic/Invisible Dropdown Elements and generate XPath for them

  • Dynamic dropdown Elements which doesn’t disappear on right click.

  • Dynamic dropdown elements which disappear on right click.

  • Load spinner


  • Verifying multiple XPaths

  • Verifying all XPaths of script in one shot.

  • Verifying all XPaths of a locator page in seconds.

  • Auto generate Axes based relative XPath. XPath relative to other element.

  • How to generate and copy XPath, selectors without opening the SelectorsHub

  • Copy XPath, selectors from the context menu just by right click on the web element.


Handle and automate all these below scenarios automatically using SelectorsHub and complete hours of task just in seconds.


iframe Elements and iframe

  1. iframe (same origin iframe)

  2. Nested iframe

  3. Cross Origin iframe

SVG Elements

  • Doesn’t support standard XPath Format

  • //svg - invalid xpath

  • Supported svg XPath syntax-
    //*[local-name()='svg']
    //*[name()='svg']

  • All other selectors supports SVG as standard


Shadow DOM Elements

  1. Shadow DOM (open)

  2. Nested Shadow DOM (open)

  3. Closed Shadow DOM

  4. Shadow DOM inside iframe

  5. iframe inside shadow dom

  6. nested shadow DOM inside iframe

  7. closed shadow DOM inside iframe

  8. SVG elements inside Shadow DOM

Note: Shadow DOM doesn’t support XPath. All other selectors can be used to access shadow DOM elements.


Bonus Lecture: Important Update on Shadow DOM for the Chrome above 96 version

Selenium 4 relative locators

  • above()

  • below()

  • near()

  • toLeftOf()

  • toRightOf()

Ex- driver.findElement(with(By.tagName("input")).above(email));


Learn about Non Interactable Elements

Elements for which XPath can be written but action can’t be performed.

Elements for which XPath can’t be written

  • Elements for which html DOM is not available

  • Web Browser based popup

  • Canvas elements

  • Form Validation & info message tooltip

Misconceptions

  • I write my own XPath & don’t use any XPath tool

  • DevTools gives the right info about XPath & Selectors

  • We shouldn’t use XPath Plugin

Certification

TestCase Studio & more important concepts about extensions
What is TestCase Studio | Installation | How to use & features | More concepts
Selectors Healing
What is Selectors Healing and how it can help to maintain automation script

Save this course

Save XPath, CSS Selector, Web,DOM, SelectorsHub & TestCase Studio to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in XPath, CSS Selector, Web,DOM, SelectorsHub & TestCase Studio with these activities:
Review Basic HTML Structure
Reinforce your understanding of HTML structure, as XPath and CSS selectors are used to target specific HTML elements.
Show steps
  • Read articles about HTML structure and common elements.
  • Practice writing basic HTML pages with different elements.
  • Inspect existing websites using browser developer tools to understand their HTML structure.
Review 'SelectorsHub: The Ultimate Guide'
Master SelectorsHub by reading a guide dedicated to its features and usage.
Show steps
  • Read the chapters on SelectorsHub's core features.
  • Practice using SelectorsHub to generate and verify selectors on different websites.
  • Explore the advanced features of SelectorsHub, such as its ability to handle shadow DOM and iframes.
Review 'CSS: The Definitive Guide'
Deepen your understanding of CSS selectors by studying a comprehensive CSS reference.
Show steps
  • Read the chapters on CSS selectors and specificity.
  • Experiment with different CSS selectors in a code editor.
  • Analyze the CSS of existing websites to see how selectors are used in practice.
Four other activities
Expand to see all activities and additional details
Show all seven activities
XPath and CSS Selector Challenges
Sharpen your XPath and CSS selector skills by completing online challenges and exercises.
Show steps
  • Find websites that offer XPath and CSS selector practice exercises.
  • Work through the exercises, focusing on different selector types and functions.
  • Review your solutions and identify areas for improvement.
Create a Selector Cheat Sheet
Consolidate your knowledge by creating a cheat sheet of common XPath and CSS selector syntax and examples.
Show steps
  • Gather examples of different XPath and CSS selector syntax.
  • Organize the examples into a clear and concise cheat sheet.
  • Share your cheat sheet with other students for feedback.
Build a Web Scraper
Apply your XPath and CSS selector skills to extract data from websites using a web scraper.
Show steps
  • Choose a website to scrape data from.
  • Use XPath and CSS selectors to identify the data you want to extract.
  • Write code to extract the data and store it in a structured format.
  • Test your web scraper and refine your selectors as needed.
Help Others with Selector Problems
Solidify your understanding by helping other students with their XPath and CSS selector challenges.
Show steps
  • Participate in online forums or study groups related to web development and automation.
  • Answer questions about XPath and CSS selectors, providing clear explanations and examples.
  • Offer constructive feedback on other students' selector code.

Career center

Learners who complete XPath, CSS Selector, Web,DOM, SelectorsHub & TestCase Studio will develop knowledge and skills that may be useful to these careers:
Test Automation Engineer
The role of a Test Automation Engineer involves designing, developing, and maintaining automated test scripts to validate software functionality. This course focusing on XPath, CSS Selectors, and tools like SelectorsHub and TestCase Studio directly translates to enhanced efficiency in test automation. Proficiency in writing robust and reliable locators is crucial, and this course builds a foundation in crafting complex XPath expressions and CSS Selectors, especially beneficial when dealing with dynamic web elements, shadow DOMs, and iframes. Mastering these skills helps the Test Automation Engineer create more stable and maintainable automation scripts, reducing test flakiness and improving overall test coverage.
Software Developer in Test
A Software Developer in Test requires expertise in both software development and testing practices to create tools and frameworks that support automated testing efforts. This course helps by providing in-depth knowledge of web element locators using XPath and CSS Selectors, as well as hands-on experience with tools that boost developer productivity. The course's emphasis on handling complex scenarios like shadow DOMs and iframes helps Software Developers in Test build resilient and adaptable automation solutions. Understanding how to write efficient and maintainable selectors helps in creating robust testing frameworks. Knowledge from this course enables faster debugging and reduces the time spent on maintaining test scripts, allowing more focus on improving software quality.
Web Application Tester
Web Application Testers are involved in the quality assurance of web applications. This course focusing on XPath, CSS Selectors, and tools for efficient web element identification can significantly enhance their productivity. The tester will learn how to effectively locate and interact with web elements, even in complex scenarios involving dynamic content, shadow DOM, and iframes. This course helps improve the accuracy and speed of test case creation, leading to more comprehensive testing. Moreover, understanding different types of XPath and CSS Selectors allows Web Application Testers to create robust tests that are less prone to breakage due to UI changes.
Automation Architect
An Automation Architect is responsible for designing and implementing automation frameworks and strategies across an organization. This course, by providing advanced knowledge of XPath, CSS Selectors, and automation tools, is highly relevant. The Automation Architect benefits from understanding how to leverage these tools and techniques to create scalable and maintainable automation solutions. The training on handling complex web scenarios and optimizing automation scripts can help in building robust and efficient automation frameworks. This knowledge ensures that the automation efforts are aligned with the overall business goals and provide a solid return on investment.
Quality Assurance Analyst
Quality Assurance Analysts play a vital role in ensuring that software products meet the required quality standards. This course focused on web element identification and automation tools can greatly assist in creating and executing test cases effectively. The course provides insights into writing efficient and reliable XPath and CSS Selectors, which are essential for automating tests and validating web application functionality. QA Analysts equipped with these skills can create more comprehensive test suites. This helps to identify and address issues early in the development cycle, leading to higher quality software releases.
Technical Tester
Technical Testers require a strong understanding of the underlying technologies and tools used in software development and testing. This course is particularly beneficial as it dives deep into XPath, CSS Selectors, and automation tools like SelectorsHub and TestCase Studio. The course helps refine the skills needed to tackle complex testing scenarios, such as those involving shadow DOMs, iframes, and dynamic web elements. Technical Testers gain the ability to create robust and maintainable test scripts. This understanding is crucial for identifying and resolving technical issues that may not be apparent through manual testing alone.
Web Developer
A Web Developer, while primarily focused on building web applications, benefits from a solid understanding of how testing and automation work since it is essential to building high quality software. This course, which covers XPath, CSS Selectors, and web debugging tools, helps them write more testable and maintainable code. It also gives the web developer a good understanding of how to craft code that is friendly to automation engineers. This course helps in becoming proficient in identifying and fixing potential issues in web applications. Web Developers can create code that is more robust and less prone to errors by understanding testing methodologies.
UI Developer
UI Developers focus on creating the user interface and experience of web and mobile applications. This course about XPath, CSS Selectors, and web element handling, can be particularly beneficial. A UI developer would be able to understand the role that automating UI interactions plays in producing quality work. The curriculum prepares UI Developers to build interfaces that are easily testable and maintainable, reducing the likelihood of UI-related bugs making their way into production. This leads to faster development cycles and a better user experience overall.
Solutions Architect
Solutions Architects are responsible for designing and overseeing the implementation of complex software systems. This course may be useful as it provides insights into web technologies and automation strategies that can inform architectural decisions. Understanding how different elements of a web application can be tested and automated allows Solutions Architects to design systems that are more robust, scalable, and maintainable. This course helps them to make informed decisions about technology choices, integration patterns, and deployment strategies.
Data Analyst
Data Analysts are responsible for collecting, processing, and analyzing data to extract meaningful insights. While this course primarily focuses on web technologies and automation, it may be useful for Data Analysts who work with web-based data sources. Knowledge of XPath and CSS Selectors is valuable for web scraping and data extraction tasks. The course could help Data Analysts more efficiently gather and process data from web pages.
Business Analyst
Business Analysts identify business needs and then determine solutions to business problems. While this course primarily focuses on web technologies and automation, it may be useful for Business Analysts involved in projects related to web applications or digital transformation. Understanding how web elements can be identified and automated can help Business Analysts better communicate requirements. This can also help develop solutions related to web-based processes.
Project Manager
Project Managers are in charge of planning, organizing, and overseeing the completion of specific projects. While this course primarily focuses on web technologies and automation, it may be useful for Project Managers involved in software development projects or digital transformation initiatives. Understanding the basics of web testing and automation can help Project Managers better estimate project timelines, allocate resources effectively, and track progress related to testing activities.
Customer Support Specialist
Customer Support Specialists mainly focus on providing assistance and resolving issues for customers. While this course may not be directly relevant to their daily tasks, a basic understanding of web technologies and automation may be useful in some cases. For instance, knowledge of XPath and CSS Selectors could help Customer Support Specialists troubleshoot technical issues related to web applications or provide better guidance to customers.
Sales Representative
Sales Representatives focus on selling products or services to customers. While this course may not be directly applicable to their daily tasks, a basic understanding of web technologies and automation may be beneficial in some contexts. For instance, knowledge of how web applications are tested and automated could help Sales Representatives better understand the technical aspects of the products.
Human Resources Generalist
Human Resources Generalists are responsible for managing a wide range of HR functions within an organization. This course may indirectly benefit HR professionals, as they might be tasked with recruiting or training employees in roles related to web development, testing, or automation. Understanding the skills and knowledge required for these roles can help HR Generalists make more informed decisions about hiring and training.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in XPath, CSS Selector, Web,DOM, SelectorsHub & TestCase Studio.
Provides a comprehensive guide to using SelectorsHub, a browser extension that helps developers write and verify XPath and CSS selectors. It covers all the features of SelectorsHub, including its smart editor, error handling, and code generation capabilities. This book is highly relevant to the course as it focuses on a tool specifically designed to improve productivity when working with selectors. It provides practical examples and tips for using SelectorsHub effectively.
Provides a comprehensive overview of CSS, covering everything from basic syntax to advanced layout techniques. It's a valuable resource for understanding how CSS selectors work and how to use them effectively. While not strictly necessary for the course, it provides a deeper understanding of CSS and its capabilities. It is commonly used as a reference by web developers.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser