Skip to main content

I want to capture the green highlighted domxpath in a list from an application however this needs to be dynamic, so every time the bot can click on the element.If you see they is a pattern in the domxpath list however when it captures the blue highlighted domxpath and move to the next element which is the green highlighted domxpath it has a seven and not a six .When I do an html inspect in chrome it shows they is a hidden element between divi5] and divi7].How do I dynamically capture the element?

//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi1]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi2]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi3]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi4]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi5]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi7]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi8]/divi1]/divi1]/p/1]/labele1]

Hi @Lesley ,

Please find the information below regarding passing the counter/increment variable in the DOMX Path  divdvCounter]. 

Firstly, determine the total number of items in the list. Iterate through the list to retrieve values based on the total count. For instance, if your application's list contains 10 records, the total count is 10. You should then iterate 10 times to obtain all the values from the list.

//formf@name='form']/div/5]/div/2]/div/1]/div/2]/div/vCounter]/div/1]/div/1]/p11]/labela1]

Note : Convert the numeric counter variable to a string and include it in the XPath

 

 

 

 

 


I want to capture the green highlighted domxpath in a list from an application however this needs to be dynamic, so every time the bot can click on the element.If you see they is a pattern in the domxpath list however when it captures the blue highlighted domxpath and move to the next element which is the green highlighted domxpath it has a seven and not a six .When I do an html inspect in chrome it shows they is a hidden element between divi5] and divi7].How do I dynamically capture the element?

//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi1]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi2]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi3]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi4]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi5]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi7]/divi1]/divi1]/p/1]/labele1]
//formr@name='form']/divi5]/divi2]/divi1]/divi2]/divi8]/divi1]/divi1]/p/1]/labele1]

Hi @Lesley,

Arasu has given a correct solution.
only thing which is missing is the try catch.

Loop
   Counter +1

   try

      recorder with dynamic Xpath //formt@name='form']/divf5]/divd2]/divd1]/divd2]/divd$nCounter.Number:toString$]/divr1]/divd1]/p]1]/labelp1]

  catch

In this case even if there is a missing element it will skip to the next


Reply