Skip to main content
Question

Unable to deal with Domx Path

  • May 30, 2023
  • 3 replies
  • 476 views

Forum|alt.badge.img+4

Hello Everyone!!

I have to create a bot to click on each profile button in the page and extract the details. In general, to do so we have to iterate with the minute change in the Domx path.

 

But in this case, I could not found a proper relation with the paths.

The following are paths of Profile buttons in the page.

//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[1]/div[4]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[2]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[3]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[4]/div[4]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[5]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[6]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[7]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[8]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[9]/div[5]/div[2]/div[1]/div[1]/button[1] 
//div[@id='root']/div[1]/div[1]/div[3]/div[1]/div[2]/div[2]/div[2]/div[5]/div[10]/div[4]/div[2]/div[1]/div[1]/button[1]

 

Can someone help me out this ? 

3 replies

Zaid Chougle
Navigator | Tier 3
Forum|alt.badge.img+17
  • Navigator | Tier 3
  • May 30, 2023

Hi @SaiRahul02 ,

Instead of extracting the full xPath, can you please share the xPath of those elements


Forum|alt.badge.img+4
  • Author
  • Navigator | Tier 3
  • May 30, 2023

Hi @SaiRahul02 ,

Instead of extracting the full xPath, can you please share the xPath of those elements

I didn’t get you. The above mentioned are the different Domx paths of the same element at different levels


Forum|alt.badge.img+2
  • Cadet | Tier 2
  • May 30, 2023

Please try to create custom domx path using common properties(like text, class) of all the profile buttons.
Along with this you can add a occurrence counter to common path.

You can create a custom path like (//div[@id='root']//button[text()=”Profile”])[##] depending on the actual values in HTML content. (## will be number of button)