cancel
Showing results for 
Search instead for 
Did you mean: 

wild card in the path

Miya
Level 5
Hi,

  when i spy a drop down i got the  path /HTML[1]/BODY[1]/DIV[33]/DIV[1]/UL[1]/LI[1] and stored it in a data item.

Actually the Div[33] value is changing when the application opens each time and i have to added the counter to LI1 value so that the next item can be picked by bot, pls can some one tell me how can i achieve this

------------------------------
Miya
------------------------------
3 REPLIES 3

Hi Miya,

Wild card will not work properly if you use App moddler. Instead of that dynamic value and pass the value from that stage where you will use this element.
I guess you are using chrome or edge browser then you can use xpath or cssselector option where you will not have any dependency in all these. 🙂

------------------------------
Amlan Sahoo
Senior RPA Consultant
WonderBotz
------------------------------
Regards,
Amlan Sahoo

Miya,

Assuming the DIV value is not completely arbitrary, but is instead incrementing as you move down the page, here is how I have done it.
Set Up
  1. In your Object Definition, set your Path as a Parameter, not a Wildcard or Explicit value
  2. In the Object itself, set a local text variable, tmp_Path ( or tmp_DataElement_path, if there are multiple values being read).
  3. Using your example, I would set the default value to '/HTML[1]/BODY[1]/DIV[X]/DIV[1]/UL[1]/LI[1]' ('X' replacing '33')
  4. Set an input number variable, Line_nbr.
Action
  1. My Process then passes the 'intuitive' line number that I want read from the page.
  2. The Object takes that value and does a light calculation.  Usually it is something like 'Line_nbr * 2' or '(Line_nbr * 2) + 1'
  3. The Object then replaces the 'X' in tmp_Path with the calculated Line_nbr
  4. The Object the passes the updated tmp_Path as a Parameter to the Wait and Read stages
  5. Lastly, of course, the Object passes the value that was read back to the Process.
There is almost certainly an argument for housing 2 and 3, above, in the Process.  That would be up to you.

I hope that helps,
Red

------------------------------
Robert Stephens
Content Manager, Supply Chain
Sutter Health
America/Los_Angeles
------------------------------
Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA

KodiSrihari
Level 8
Hi Miya,

following are the steps to get the values:-

-Make the Path of the attribute in the element as Dynamic.
-Copy the Path to a Notepad and Divide the path into parts like before 33 one part and next to 33 other part and store in two data items as Start of path and End of Path.
-Make a note of how much the 33 number is changing each time application opens , set the counter to the same value.
-Now in the stage against the element Params dynamic part use the Expression Start path ,Count and End Path with Concatenate symbol between them.
-Set Max count how many times it should open application or Extract data.
-Set a Decision stage so the it will check the counter to achieve Max Count then stops and end Process.

i hope this can help you in finding the solution.

Thanks,

------------------------------
Srihari
RPA Developer
------------------------------