Forum Discussion

tmahender12's avatar
tmahender12
Frequent Contributor
8 years ago

Xpath usage in Webtesting

iam using evaluatexpath in automating webapplication,but performance is slow, so can you let me know is Namemapping is suggested ot usage of XPATH's?

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You are correct... XPath is, generally, slow because in order to use XPath, you need to parse the whole document.  Using NameMapping and Aliases does the object identification based upon object properties and hierarchal relationship... and if you get everything mapped up front and done properly, I believe things SHOULD run a bit faster.

    YMMV... some folks swear by XPath, some swear by NameMapping... I think it's possible to use a blend of both but I lean towards using NameMapping for most stuff and then XPath for the things that we can't do with NameMapping.