HomeSelenium

Selenium Locators – XPath Functions

Selenium Locators – XPath Functions

<<Previous Post                            << Complete Tutorial>>                              Next Post>

In continuation of the previous articles on Relative XPath Expressions, I am going to explain the usage of XPath Functions as part of XPath Expressions in this article.
Pre-requisites:

  • > Refer previous articles on Relative XPath Expressions

Let’s get started.

Selenium Locators – XPath Functions

The following are the different XPath functions that are generally used in Selenium:

  1. text()
  2. contains()
  3. starts-with()
  4. last()
  5. position()

Apart from the above listed functions, we have below functions in XPath that we don’t generally use in Selenium:

  1. id()
  2. name()
  3. count()
  4. local-name()
  5. namespace-uri()
  6. string()
  7. concat()
  8. substring-before()
  9. substring-after()
  10. substring()
  11. string-length()
  12. normalize-space()
  13. translate()
  14. boolean()
  15. not()
  16. true()
  17. false()
  18. lang()
  19. number()
  20. sum()
  21. floor()
  22. ceiling()
  23. round()

As already mentioned, we don’t have to learn all the functions listed above, intead we should only learn the first five functions as part of Selenium (i.e. text(), contains(), starts-with(), last() and position())

I will practically demonstrate all these required 5 functions of XPath in the next article.

Next Steps:

  • > To learn more about Selenium, continue to the next post (Click on Next Post link below)
  • > Check complete Selenium Tutorial Contents here (Click here)

Please leave your questions/comments/feedback below.

Happy Learning ?

About Me > Arun Motoori

On a mission to contribute to the Software Testing Community in all possible ways.

<<Previous Post                            << Complete Tutorial>>                              Next Post>

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

For FREE Testing Tutorials & Videos

X
Open chat
Contact Us on Whatsapp