Learn XPath selectors in 10 minutes
Hellow guys, Welcome to my website, and you are watching Learn XPath selectors in 10 minutes. and this vIdeo is uploaded by Ivan and code at 2022-02-11T14:20:29-08:00. We are pramote this video only for entertainment and educational perpose only. So, I hop you like our website.
Info About This Video
Name |
Learn XPath selectors in 10 minutes |
Video Uploader |
Video From Ivan and code |
Upload Date |
This Video Uploaded At 11-02-2022 22:20:29 |
Video Discription |
Use XPath selectors to find an element of the HTML page or XML data structure. You must know this to write readable and stable tests in any UI automation framework (Cypress, Selenium, Webdriverio, etc.). Another use case for XPath is "data scraping".
This video is part of the "Cypress test automation tutorial".
Full playlist:
https://www.youtube.com/playlist?list=PL_QQ5oCdr7sNimlvVdtrrRNjZi2wwkQOF
Also, check out the "CSS selectors in 10 minutes" video:
https://youtu.be/9mgykIxP5SY
-----------------------------------------------------------------------------------------------
----------- Selectors used in this demo --------------------------------------
-----------------------------------------------------------------------------------------------
Common selector patterns.
//meta - selecting by element type
//*[@id="root"] - selecting by id
//*[@class="App"] - selecting by class
More complex selectors.
They allow you to traverse DOM.
//header/h1 - child (element one level below in the DOM)
//div//h1 - descendant (element one or more levels below in the DOM tree)
//h1 | //p - union (pipe separated)
//p/.. - traverse DOM up (parent of p)
//a[@target="_blank" or @target="_self"] - union by attribute
Attribute selectors
//a[@target="_blank"] - by attribute & value
//a[contains(@target, "_bl")] - by attribute & "wildcard" value
//a[starts-with(@target, "_")] - by attribute "starts with" value
Arithmetic operations
//a[@value=10] - by evaluating value content
-----------------------------------------------------------------------------------------------
----------- Timeline --------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
0:00 - intro
0:35 - demo app
1:00 - common & simple selectors
1:52 - traversing the DOM
4:44 - attribute selectors
6:01 - arithmetic operations
6:25 - XPath versions 2 & 3
6:50 - XPath vs CSS selectors
7:55 - testability reminder |
Category |
Science & Technology |
Tags |
xpath tutorial for beginners | what is xpath | why is xpath used | how to create xpath | how to create absolute xpath | how to create relative xpath | how to create xpath for html web elements | how to create xpath for selenium | selenium xpath tutorial | learn xpath | xpath beginners tutorial | locators | webdriverio | cypress | playwright | testing | contains | child | find html element | xml | easy | relative xpath | absolute xpath | css selectors | css selector | xpath | xpath selector | xpath selectors |
More Videos