What is XPath | How to create XPath | for Beginners
website - automationstepbystep.com/
0:00 Intro
1:16 what XPath is - a query language
1:50 Examples of where we can use XPath
2:08 Extracting a value using XPath
2:40 Defining the specific book element to access by giving the position
3:30 Examples of XPath tools online (links also in description
3:50 XPath Generator for testing/generating XPaths
4:55 Tool 2 - XPather for formatting/prettifying/indenting
5:52 XML Toolbox - click on the element/node to create XPath for
6:35 Absolute XPath - starts from the route and goes to the end node (slow, complex)
7:08 Relative XPath - a better alternative to the above
7:48 Relative XPath not affected by 'breaking' changes while Absolute XPath will break
8:20 Example inspecting DOM in Google
8:55 Testing Relative XPath in Google with Chrome Dev Tools
9:55 Creating XPaths for tools like Selenium
10:15 Summary of points covered
What is XPath
How to create XPath
What is absolute XPath
What is relative XPath
How to create XPath for web elements
References
XPath tools online
www.easycodeforall.com/XPathU...
xpather.com/
xmltoolbox.appspot.com/xpath_...
Join Automation Step By Step channel: kzread.info...
Udemy Discounts - automationstepbystep.com/udem...
Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can.
_______ ONLINE COURSES TO LEARN _______
automationstepbystep.com/onli...
GitHub - github.com/Raghav-Pal/
Udemy - www.udemy.com/user/raghav-pal-3/
Training by Raghav at your venue - raghav.qna@gmail.com
Training schedule - automationstepbystep.com/trai...
----------- UI TESTING -----------
Selenium Beginners - bit.ly/2MGRS8K
Selenium Java Framework from Scratch - bit.ly/2N9xvR6
Selenium Python - bit.ly/2oyMp5x
Selenium Tips - bit.ly/2owxc50
Selenium Builder - bit.ly/2MKNtlq
Katalon Studio - bit.ly/2wARFdi
Robot Framework with RIDE- bit.ly/2Px6Ue9
Robot Framework with Eclipse - bit.ly/2N8DZxb
Protractor - bit.ly/2KtqVkU
TestProject - bit.ly/2DRNJYE
----------- API TESTING -----------
Web Services (API) - bit.ly/2MGafL7
SoapUI - bit.ly/2MGahmd
Postman - bit.ly/2wz8LrW
General - bit.ly/2PYdwmV
Katalon Studio API Testing - bit.ly/2BwuCTN
----------- MOBILE TESTING -----------
Appium - bit.ly/2ZHFSGX
Mobile Playlist - bit.ly/2PxpeUv
----------- CI | CD | DEVOPS -----------
Jenkins Beginner - bit.ly/2MIn8EC
Jenkins Tips & Trick - bit.ly/2LRt6xC
Docker - bit.ly/2MInnzx
Kubernetes - bit.ly/2MJIlMK
------------VIRTUALISATION------------
Virtualization on windows - bit.ly/2SItIL9
----------- VERSION CONTROL SYSTEM -----------
Git & GitHub - bit.ly/2Q1pagY
GitLab - bit.ly/2kQPGyQ
----------- PERFORMANCE TESTING -----------
JMeter Beginner - bit.ly/2oBbtIU
JMeter Intermediate - bit.ly/2oziNVB
JMeter Advanced - bit.ly/2Q22Y6a
JMeter Tips & Tricks - bit.ly/2NOfWD2
Performance Testing - bit.ly/2wEXbLS
----------- PROGRAMMING -----------
Java Beginners - bit.ly/2PVUcXs
Java Tips & Tricks - bit.ly/2CdcDnJ
GROOVY - bit.ly/2FvWV5C
JAVASCRIPT - bit.ly/2KJDZ8o
PYTHON - bit.ly/2Z4iRye
----------- IDE -----------
Visual Studio Code - bit.ly/2V15yvt
----------- BUILD TOOLS -----------
Maven - bit.ly/2NJdDRS
Gradle - bit.ly/30l3h1B
----------- OTHERS -----------
Redis- bit.ly/2N9jyCG
Misc - bit.ly/2Q2q5xQ
Tools & Tips - bit.ly/2oBfwoR
QnA Friday- bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
---------- Connect with Raghav -----------
Website - automationstepbystep.com/
LifeCharger - lifecharger.org/
Udemy Courses - www.udemy.com/user/raghav-pal-3/
Facebook - / automationstepbystep
Twitter - / learnwithraghav
KZread - / automationstepbystep
Never Stop Learning
Raghav
Пікірлер: 211
Your tutorials are everything, especially for someone like me who can not afford school... you have helped me so much!! You Are The Absolute Best Period!
@RaghavPal
2 жыл бұрын
You are so welcome!
@anthonywright5275
2 жыл бұрын
Hi October, I see you have interest in XPath, may I ask what profession it is that you work in or seek?
Very well explained, no lengthy content, just crisp and precise, hats off
@RaghavPal
2 жыл бұрын
Thanks for watching
Thanks for this, very clear. My notes below in case they help others: 1:16 what XPath is - a query language 1:50 Examples of where we can use XPath 2:08 Extracting a value using XPath 2:40 Defining the specific book element to access by giving the position 3:30 Examples of XPath tools online (links also in description 3:50 XPath Generator for testing/generating XPaths 4:55 Tool 2 - XPather for formatting/prettifying/indenting 5:52 XML Toolbox - click on the element/node to create XPath for 6:35 Absolute XPath - starts from the route and goes to the end node (slow, complex) 7:08 Relative XPath - a better alternative to the above 7:48 Relative XPath not affected by 'breaking' changes while Absolute XPath will break 8:20 Example inspecting DOM in Google 8:55 Testing Relative XPath in Google with Chrome Dev Tools 9:55 Creating XPaths for tools like Selenium 10:15 Summary of points covered
@RaghavPal
Жыл бұрын
Thanks a lot Stephen, will add this in video description as well
This is by far the best xpath tutorial for beginners. Athough I have used xpath for several years, I can still learn something from this video.
@RaghavPal
2 жыл бұрын
I am so happy & humbled to see your message Ellie
Awesome, very helpful, short and packed with helpful information!
@RaghavPal
2 жыл бұрын
Most welcome Mike
Extremely helpful content. This is so easy to understand from your video. Great work
@RaghavPal
2 жыл бұрын
Thanks Tarvinder
It's clear and step by step explanation. Thank you.
@RaghavPal
2 жыл бұрын
Most welcome Dmitriy
Thank you for the very clear and step by step explanation!
@RaghavPal
Жыл бұрын
You are welcome Tom
Thank you Raghav. This was a great tutorial for me to review different aspects of XML.
@RaghavPal
Жыл бұрын
Glad it was helpful!
VERY VERY CLEAR EXPLATION.THANK YOU SIR.
@RaghavPal
3 жыл бұрын
You are welcome
Excellent information, very clearly explained. Thanks!
@RaghavPal
Жыл бұрын
Glad it was helpful!
Thank you SO MUCH for this information. VERY HELPFUL!! Thanks!!
@RaghavPal
2 жыл бұрын
Most welcome Megan
Nice and clear demo.. Thank you !!!
@RaghavPal
2 жыл бұрын
Most welcome Himali
This is the best explaination with no time wasting... thank you so much
@RaghavPal
3 ай бұрын
Most welcome.. humbled
Thanks for this tutorial, it was extremely helpful!
@RaghavPal
Жыл бұрын
Most welcome Noemi
Best video yet! Thankyou so much
@RaghavPal
3 жыл бұрын
You're so welcome Patrick
Thank you for this very useful video!
@RaghavPal
6 ай бұрын
Glad it was helpful!
bro literally explained my 2hrs lecture in 10 mins..kudos
@RaghavPal
Жыл бұрын
Glad it helped Hari
Great Session! Thank you Raghav!
@RaghavPal
2 жыл бұрын
Most welcome Mansi
Thanks for the video, it's helped me with current task
@RaghavPal
3 жыл бұрын
Glad to hear that Kyrylo
Very good explanation. Thank you
@RaghavPal
6 ай бұрын
Most welcome
Thank you for your help I really needed it and now I get it.
@RaghavPal
7 ай бұрын
Glad it helped Mateusz
You are such a sweet tutor. much love for ur knowledge and simplicity. Waiting for more videos like this from u sir!!
@RaghavPal
3 жыл бұрын
So nice of you Vempadapu
Great video, thank you!
@RaghavPal
6 ай бұрын
Most welcome Felipe
Thanks for sharing! Very good info!
@RaghavPal
Жыл бұрын
Most welcome
it's really helpful and easy to understand thanks for this tutorial Sir
@RaghavPal
2 жыл бұрын
You are most welcome Dhrubajyoti
Extremely helpful video explained in easy way! I appreciate ur efforts Thank u
@RaghavPal
2 жыл бұрын
Thanks Kenza
@kenzakhelkhal7931
2 жыл бұрын
@@RaghavPal U're welcome
If its related to tech knowledge then there is always an Indian guy who can explain it better. Finally found the video that actually helped me find the xpath. Thank you
@RaghavPal
7 ай бұрын
Glad to know it was helpful
Thank you Raghav! I enjoy your video
@RaghavPal
3 жыл бұрын
Glad to hear that Svetlana
Very informative. Thank you
@RaghavPal
Жыл бұрын
Glad it was helpful Ravi
Informative! Good job!
@RaghavPal
2 жыл бұрын
Glad it was helpful!
Very clear explanation thank you
@RaghavPal
2 жыл бұрын
Glad it was helpful!
Thanks for this wonderful session
@RaghavPal
2 жыл бұрын
Always welcome Umesh
extremely educational and properly described- thanks @raghav
@RaghavPal
Жыл бұрын
Most welcome Rahul
Thank you, that is quality content!
@RaghavPal
Жыл бұрын
Most welcome Tural
Thank you so much sir. Very clear.
@RaghavPal
Жыл бұрын
You are welcome
Very informative video.
@RaghavPal
Ай бұрын
Glad it was helpful Ritesh
You Are a good tutor..... thank you
@RaghavPal
2 жыл бұрын
Most welcome Husain
Thank you so much sir u r a life saviour❤️
@RaghavPal
2 жыл бұрын
Most welcome Saurav
Man, you're the best!
@RaghavPal
2 жыл бұрын
Thanks a lot
Very Good Explanation....
@RaghavPal
2 жыл бұрын
Thanks
thanks a lot...v clear explanation
@RaghavPal
3 жыл бұрын
Thanks
very nice explanation sir
@RaghavPal
Жыл бұрын
Thanks and welcome
Bro you are awesome thank you very much
@RaghavPal
2 жыл бұрын
Welcome 😊
Nice way to explain 👍
@RaghavPal
2 жыл бұрын
Keep watching Shashikant
in germany we would call you "ehrenmann". Love your tutorials.
@RaghavPal
2 жыл бұрын
Thanks a lot
Thank u Really u're great♥️
@RaghavPal
3 жыл бұрын
Most welcome Gehad
Super teaching skills Mr Raghav Pal
@RaghavPal
3 жыл бұрын
So nice of you
Thank you so much ❤🔥
@RaghavPal
6 ай бұрын
You're welcome!
Thank you for this video
@RaghavPal
3 жыл бұрын
So nice of you Kajol
Your Way of Explanation is very good , Easy to understand..!! Have you done videos on Workday..?
@RaghavPal
9 ай бұрын
Not yet Pradeep
Best vid for xpath basic
@RaghavPal
3 жыл бұрын
Glad to read your message Abhi
Very helpful
@RaghavPal
Жыл бұрын
Glad it helped Jhansi
Thank you soo much bro!!
@RaghavPal
3 жыл бұрын
Most welcome
Thank you sir and good 👍 explanation
@RaghavPal
2 жыл бұрын
Always welcome
thank you sooo much!!
@RaghavPal
Ай бұрын
You're welcome Meria
Awesome, thanks
@RaghavPal
3 жыл бұрын
Most welcome Matt
thanks for the session, just wondering if in the future another book is added on the book 2 place, then your xpath wont be valid anymore for that particular query, so how to deal with that smartly that it wont be broken, should there be any changes in the payload
@RaghavPal
3 жыл бұрын
Hi Rafi, very good question, and this is why we use dynamic xpaths with regular expressions. Can check more here - kzread.info/head/PLhW3qG5bs-L83gLEZVIDHOvgTTz27po_0
Searched for XPATH and what a brilliant and sample tutorial I found.
@RaghavPal
3 жыл бұрын
So happy to see this Ayub. Can find all here - automationstepbystep.com/
Thank you!
@RaghavPal
3 жыл бұрын
You're welcome Nini
Thank you!!
@RaghavPal
3 жыл бұрын
You're welcome!
Thanks so much
@RaghavPal
2 жыл бұрын
Most welcome
Thank you sir
@RaghavPal
2 жыл бұрын
Most welcome
thank u soooooo much bro
@RaghavPal
Жыл бұрын
Always welcome Ravi
Muito obrigado, me ajudou muito. tks
@RaghavPal
2 жыл бұрын
Muito bem-vindo
Thank for the video! What are you doing about Sedna DataBase (clean XML without SQL DB)?
@RaghavPal
3 жыл бұрын
Will need to check on that
@pmak6074
3 жыл бұрын
@@RaghavPal Ok! Thank's!
Thank you
@RaghavPal
Жыл бұрын
Most welcome
very helpful
@RaghavPal
3 жыл бұрын
Thanks Akash
Thank you!
@RaghavPal
3 жыл бұрын
You're welcome!
Thank you
@RaghavPal
2 жыл бұрын
Most welcome
thank you
@RaghavPal
7 ай бұрын
Most welcome
Hi sir, i tried exactly like your tutorial, but when i run in eclipse, there an error "The method xpath(String) in the type By is not applicable for the arguments (void)". Hope you can help
@RaghavPal
3 жыл бұрын
Hi Haney, looks like you are not able to pass a valid object, Pls check your code again, You can do debugging
Clarity 💯
@RaghavPal
Жыл бұрын
Thanks
Broooo thank you
@RaghavPal
3 жыл бұрын
Most welcome Karan
When you clicked title element, the xpath generated in that website has lang element also. Is it necessary to have that element also?
@RaghavPal
3 жыл бұрын
Hi Naveen, although I cannot recall, but should not be necesary
thank u
@RaghavPal
3 жыл бұрын
Most welcome Visham
Hi Raghav Pal, What to do when xpath or ID doesn't work in the current page? for example, the page has everything is there just like a normal page. but when I select the element that I want and >right click> copy> copy xpath and try to search for it "Ctrl F" it does not show any results. how can I figure that out? Thank you so much, your videos always helped me a lot!!!
@RaghavPal
3 жыл бұрын
Hi Gilson, in that case you can use parent child or hierarchy to generate xpath. Some helpful videos - kzread.info/head/PLhW3qG5bs-L83gLEZVIDHOvgTTz27po_0
Hello, i need to check where the icon on my webpage is closed or open. how can i choose are create a locator.
@RaghavPal
3 жыл бұрын
Hi Yasashree, although I do not know entirely about your app and scenario, I can say that if the DOM XML of your app changes with open or close status, you can just verify that property using xpath
I am going to use this tutorial for RPA object extraction Is it right way to go with !!
@RaghavPal
Жыл бұрын
It will help for any XML based app or doc
Subscirbed, liked and thank you.
@RaghavPal
8 күн бұрын
Welcome aboard Sam
Супер !!! Спасибо!!!
@RaghavPal
11 ай бұрын
Наиболее желанный
Tq sir
@RaghavPal
3 жыл бұрын
Most welcome
have you course video about python + selenium tool + pytest frame work for automation ?
@RaghavPal
3 жыл бұрын
Yes, can check here - automationstepbystep.com/
You give to simple of examples. In the bookstore xml file add multiple authors to a single book and use XPath to return all authors for that book. Why does it only return only the first occurrence whenever there are multiple authors for a book. Thanks.
@RaghavPal
2 жыл бұрын
Hi, depends on the xml and xpath used, I will try to add some more examples
Hi,can u please help me for handling snackbar using appium java
@RaghavPal
2 жыл бұрын
Hi Ramya, not much info on this, will need to check online
Sir, i am not able to verify xpath for those element which are inside shadow root in dom. DevTools showing 0 matching node. How can i verify if it is wrong or right?
@RaghavPal
3 жыл бұрын
Hi Kriti, will need to see some examples on how to handle shadow root dom. I will also plan to add a session
@kritishah1659
3 жыл бұрын
@@RaghavPal sure sir thank you for reply.
@kritishah1659
3 жыл бұрын
On Google search, sir i got to know devtools doesn't support shadow dom and xpath also. There is a tool Selectorshub which support shadow dom and it gives the right count.
@RaghavPal
3 жыл бұрын
It will be helpful
Can anyone please help me here ? I want to run two xpath together and store the value, I am not sure if it is possible. My one xpath is fetching City and second is state //div[(text()='city')]/following-sibling::div //div[contains(text(),'state')]/following-sibling::div As xpath is telling name of city and state is provided in next div of city and state. I want to run both and capture output in string format. On side note: both xpath is working fine for me. City London state England
@RaghavPal
Жыл бұрын
Hi Rahul, will need to check some examples online
👍
@RaghavPal
2 жыл бұрын
Thanks Amrit
How can I pass dictionary value inside xpath ?
@RaghavPal
2 жыл бұрын
I will need to check on that
Pretty good video, although introducing XPath you did not describe the notation utilized. Mentioning arrays and the query notation but not describing what they mean can be confusing to those who might be unfamiliar. Otherwise, great job
@RaghavPal
2 жыл бұрын
Hi, I will check on that
I need small real time project for beginners and simple
@RaghavPal
2 жыл бұрын
Hi Maya, will need to check online
3:11 doesn't it count from 0?
@RaghavPal
2 жыл бұрын
I will check
No one writes xpath, generating xpath in cmpny too?
@RaghavPal
5 ай бұрын
Mostly, but having knowledge on xpath will help
helpful as fuck. 🤙
@RaghavPal
2 жыл бұрын
Thanks for watching
ppl on the tv gone say forward slash all they want, im gonna keep calling it an up slash
@RaghavPal
10 ай бұрын
ok
Harry Potter category="children"??? But anyway, nice video man
@RaghavPal
Жыл бұрын
Thanks
Thank you sir
@RaghavPal
2 жыл бұрын
Most welcome Beekas
👍
@RaghavPal
3 жыл бұрын
:)