
Selenium- Locators Java
Presentation
•
Computers
•
Professional Development
•
Hard
Suganthy m
Used 13+ times
FREE Resource
8 Slides • 0 Questions
1
Selenium- Locators Java
Suganthy M

2
What is a dynamic element on the web page?
dynamic element is an element which has 'dynamic attributes' and/or 'dynamic location' on the web page.
3
How to locate the dynamic elements on the web page?
We can locate dynamic elements using:
(a) Absolute XPath
(b) Relative XPath using Functions and Axes
(c) CSS (refer: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
4
XPath Facts
1. XPath stands for XML Path Language
2. powerful way of navigating through the DOM of any XML-like language document using XPathExpression, such as HTML
3. XPath uses a path notation (as in URLs) for navigating through the hierarchical structure of an XML document.
5
When would we use XPath locator in Selenium?
When locating the element through name or id is not possible.
the element does not have id attribute of name attribute
The id, name attribute of the element changes dynamically
if possible use By.id or By.name as less faster and more readable code
6
How to locate the dynamic elements using XPath?
XPath functions like starts-with(), text(), contains()
XPath Axes - An axis represents a relationship to the context node, and is used to locate nodes relative to that node on the tree. example:
Examples of XPath axes are : parent, child, ancestor, self, following-sibling, descendant-or-self
7
XPath: absolute XPath and relative XPath
Absolute XPath - Absolute XPath begins from the root element "/" and traverses through the DOM tree until it reaches the desired element.
disadvantage : if Note that if the DOM tree structure above the desired element changes in future, the absolute path will not work.
Relative XPath starts with double slash '//' and indicates path relative to any element in the DOM indicated by the XPath expression.
8
//a[starts-with(@href, "https://play.google.com/")]
any or all anchor elements that have 'href' attribute with value that starts with the text in quotes
@ precedes attribute name to indicate attribute
//a refers to all HTML anchor tags in the page
the [
Selenium- Locators Java
Suganthy M

Show answer
Auto Play
Slide 1 / 8
SLIDE
Similar Resources on Wayground
6 questions
宇宙と季節
Presentation
•
KG
6 questions
EDUC 207 -1
Presentation
•
University
8 questions
SEMINARIO QUIZIZZ
Presentation
•
Professional Development
7 questions
COVER LETTER
Presentation
•
Professional Development
6 questions
Web Technologies
Presentation
•
University
5 questions
Cybersecurity Tabletop Exercise - Personal Cybersecurity
Presentation
•
Professional Development
6 questions
Lesson 5 Parents and the Community Role in Nation-Building
Presentation
•
Professional Development
6 questions
Week 3 CAD 154
Presentation
•
University
Popular Resources on Wayground
6 questions
PRIDE Always and Everywhere
Presentation
•
12th Grade
20 questions
Lab Safety Quiz
Quiz
•
6th Grade
26 questions
KOR Review Kahoot Questions
Quiz
•
8th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
12 questions
Unit Zero lesson 2 cafeteria
Presentation
•
9th - 12th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
10 questions
Riddles Riddles fun Riddles
Quiz
•
6th - 12th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
Discover more resources for Computers
10 questions
Soup, Salad, or Sandwich?
Quiz
•
1st Grade - Professio...
20 questions
Employability Skills
Quiz
•
Professional Development
9 questions
How to Email your Teacher
Quiz
•
Professional Development
25 questions
2023 Pop Culture Trivia
Quiz
•
Professional Development
20 questions
Cinema Camera Angles
Quiz
•
9th Grade - Professio...
20 questions
Sports trivia
Quiz
•
Professional Development
21 questions
Shop Safety
Quiz
•
Professional Development