Div value in domxpath keeps changing- Automation anywhere



  • i have to get the Inner text based on dom x- path, but in the x-path div value keeps changing. how do i do it in automation anywhere object cloning in Chrome browser.

    The xpath I am using is:

    /html/body/div[5]/div[1]/section[1]/div[2]/div[1]/div[1]/div[2]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr[1]/td[5]/span[1]/span[1] /html/body/div[5]/div[1]/section[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[2]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/div[1]/div[1]/table[1]/tbody[1]/tr[1]/td[5]/span[1]/span[1] 
    


  • I'd try first of all seeing in the webpage source if the element has a unique ID so instead you can use something like

    driver.findElement(By.ID("ABCD")
    

    If the element doesn't have a unique ID or name, add some html of the element and I'll happily help to try and find a unique locator for the element


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2