How to use xPath as a browser action selector, which is changing dynamically

Certified Senior Developer

I am developing browser automation for a website, using xPaths as the element selector for browser interactions. Whenever the website I am working on gets updated, the element xPaths change randomly. Is there any way to overcome this issue, or do I have to test and modify the browser action xPaths every time there is an update to the website?

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Associate Developer

    Hello  ,

    May I know how you configured your XPath? Or what type of updates in the website is making your XPath change dynamically?

    Because, when we configure XPath,

    i) we mostly should avoid indexing which may change on any updates in the website and 

    ii) specify in which tag you want to search ( example:    //div[@id='name']   ) .

    But if your XPath is unique, then I would like to know more about how you are configuring XPath and what type of updates are happening in your website.

Reply
  • +1
    Certified Associate Developer

    Hello  ,

    May I know how you configured your XPath? Or what type of updates in the website is making your XPath change dynamically?

    Because, when we configure XPath,

    i) we mostly should avoid indexing which may change on any updates in the website and 

    ii) specify in which tag you want to search ( example:    //div[@id='name']   ) .

    But if your XPath is unique, then I would like to know more about how you are configuring XPath and what type of updates are happening in your website.

Children
No Data