How to write Dynamic XPath in Selenium

Hi All,

Welcome to Selenium tutorial, today we will see how to write Dynamic Xpath in Selenium because we can’t go ahead without xpath in details.`

We have two awesome plugins,which actually help you write xpath. Please check out below two plugin

Firefox Plugin XPath Generating tool

Chrome XPath Plugin  

Once you are done with xpath I will highly recommend you to visit Dynamic CSS as well which is highly used in Cross-browser Testing as well.

 

Here is the Youtube video for Dynamic XPath

 

 

 

Relative XPath method

 

Using single attribute

And so on.

Dynamic XPath in Selenium

Using multiple attribute

 

XPath in Selenium1

 

And so on.

 

Using contains method

And so on.

Dynamic Xpath in Selenium

Using starts-with method

Dynamic XPath in Selenium

 

Using Following node

 Dynamic Xpath in Selenium

Using preceding node

Dynamic Xpath in Selenium

Absolute XPath method

1-/html/head/body/div/input

 

Absolute-xpath

Absolute-xpath1

Relative and Absolute XPath method

 

Hope you are comfortable with xpath now. Please start writing xpath from your side and let me know if you are facing any issue.

 

For More updates Learn Automation page

For any query join Selenium group- Selenium Group

 

118 Comments

  1. vinod singh
  2. Lee
  3. aridevi
  4. Ravi Gavkare
  5. Sandeep Rapaka
  6. Kevin R. Mariano
  7. Aklakh Ahmad
  8. Ankit Nigam
  9. Vikas
  10. Devi
  11. sangeeta
    • sangeeta
  12. Ranjith Samalla
    • Atish Kadu
      • Ranjith Billakanti
  13. Rajani
  14. Sridhar
    • Sridhar
  15. swamil
  16. Gaurav Khurana
  17. pooja pilkhwal
  18. Vaishali
      • bhaskar
  19. Ranjith Billakanti
  20. VDS Anusha
  21. ashok mandadi
  22. Neeraj Attri
  23. Ashim Paudel
  24. sudhr
  25. Divya
  26. lalitha
  27. Soniya Vijaywargi
  28. Arun
      • sandeep
      • Naveen
  29. Sanjeev Gautam
  30. Satheesh
  31. Anika Mittal
  32. Mayank
  33. aakash
  34. Abhijeet
  35. Prasad
  36. prathap
  37. Sandhya
  38. satish narayana kakimukkala
  39. Jai Prakash Keswani
  40. yashika
    • Nagaraj Byndoor
  41. bhaskar
  42. bhaskar
  43. Anjali Aswani
  44. Srikanth
  45. Sandeep
  46. Nur
  47. sairam
  48. Omar
  49. Satyanarayan Panigrahi
    • Mukesh Otwani

Leave a Reply