Forum Discussion

lkalli's avatar
lkalli
Occasional Contributor
2 years ago

Object Hierarchy is different for same webelement

I have a page object. every time I locate an element getting located in as a different hierarchy.

 

How to keep one element under the same hierarchy every time we locate it!!

 

Need more details on how object hierarchy works!

4 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    You have labelUserId that belongs to browser_new and browser2. Are you testing just one web application? If yes, then I suggest you read the link that I have provided and understand how the model works.

     

     

    • lkalli's avatar
      lkalli
      Occasional Contributor

      Thanks and will go through it for more understanding

    • lkalli's avatar
      lkalli
      Occasional Contributor

      Please see if it helps

      NameMapping.Sys.browser_new.pageLogin.labelUserId

      NameMapping.Sys.browser2.<pageName>.labelUserId