Complete Xpath from Basic to Advance | 14 Xpath Function | All Xpath AXES | Xpath tutorial

Complete Xpath from Basic to Advance | 14 Xpath Function | All Xpath AXES | Xpath tutorial

Automation Zone

54 года назад

103,536 Просмотров

This will be one complete tutorial that will cover Everything in XPaths.
Demo page 1 : https://theautomationzone.blogspot.com/2020/07/xpath-practice.html
Demo page 2 : https://theautomationzone.blogspot.com/2020/07/sample-webtable-3.html

Topics are as follows :
Into :(0:00)
Basics :(1:36)
Using OR & AND :(8:12)
innerText or text function :(11:20)
Parent / Child is Unique :(12:53)
Xpath with Index :(18:10)
Absolute vs Relative :(21:07)
Advance - Elements as an Attribute (23:02)

Part 2 & Part 3 :- XPath Functions
Contains :(25:52)
Starts-With :(29:17)
Position :(30:42)
Last :(32:34)
Count :(34:13)
Ignore Space - normalize-space :(36:35)
Ignore Case - translate (41:00)
Ignore Space + Ignore Case :(46:00)
String-Length :(49:00)
Floor and Round :(50:30)
Not :(53:05)
substring-before | Substring-after :(55:20)

Part 4 : AXES
AXES intro :(58:34)
parent :(1:00:37)
ancestor and ancestor-or-self :(1:02:36)
child and descendant :(1:05:32)
following and following-sibling :(1:08:28)
preceding and preceding-sibling - same and above
Example :(1:12:25)

XPath Basic : https://youtu.be/n7YcqFJc8NM
XPath Functions Part 1 : https://youtu.be/5Lzhv7882LU
Xpath Functions Part 2 : https://youtu.be/zzcFOxtAhxM
XPath Axes : https://youtu.be/q2bA4tIt78E

Code Snippet :
Xpath in Selenium
===================
//*[@id='value'] - Any Elements by id
//*[@name='value']- Any Elements by name
//*[text()='value']- any Elements by text
//input[@id='value']- input Elements by id
//div[text()='value']- input Elements by text
//input[@id='value' and @name='value'] - two or more attributes
//input[@id='value' or @name='value'] - two or more attributes
//div[@id='value']/.. - one element up
//div[@id='value']/input - one element down by tag
//div[@id='value']/div/input - two element down by tag
//div[@id='value']//input - any level inside the element
//div[@id='value']//input[1] - first element inside an element wit tag
//div[@id='value']//input[@id='value'] - element inside an element with tag and attribute
Elements as attributes
//div[@id='value']/..
//*[div[@id='value']]
//div[@id='value']/../..
//*[*[div[@id='value']]]

Xpath Contains and Positions and more
============================
contains()
starts-with()
last() - tables
position() - use checkboxes in tables
count() - tables is an example

Xpath Ignore Case and Whitespaces and more
============================
normalize-space() - example with spaces
translate() - replace example
not() - take any example
floor()
round()
string-length(string)
substring-before(string1, string2)
substring-after(string1, string2)

Xpath Axes
===========
ancestor
ancestor-or-self
attribute
child
descendant
descendant-or-self
following
following-sibling
parent
preceding
preceding-sibling
self

Тэги:

#selenium #tutorials #easy #relative_xpath #absolute_xpath #xpath_in_selenium #xpath_tutorials #basic_xpath #learn_xpath #xpath_locators #ancestor #ancestor-or-self #attribute #child #descendant #descendant-or-self #following #following-sibling #namespace #parent #preceding #preceding-sibling #self #contains #xpath_contains #normalize-space #translate #substring #string-length #ignore_case #ignore_space #complete_xpath_tutorial #everything_in_xpath #xpath_zero_to_hero #xpath_tutorial
Ссылки и html тэги не поддерживаются


Комментарии: