cancel
Showing results for 
Search instead for 
Did you mean: 

Web path changing - used * & ? & +

NileshJadhav1
Level 3
Hi All,

I am trying to automate one website using chrome however unable to automate that as the element path creating unique number (Not dynamically)

Example
/HTML[1]/BODY[1]/DIV[1]//DIV[6]/DIV[52]/DIV[1]/..........
/HTML[1]/BODY[1]/DIV[1]//DIV[6]/DIV[192]/DIV[1]/.........

in above path some time i am getting 52 some time 192 that mean no fix number, and this is drop down

I try below things but it's not identify any element.

1.I kept Match type as wildcard and in value added star sign (*)
/HTML[1]/BODY[1]/DIV[1]//DIV[6]/DIV
  • //DIV[1]/

    2.I kept Match type keep as regex and in value added question mark sign (?)
    /HTML[1]/BODY[1]/DIV[1]//DIV[6]/DIV[?]//DIV[1]/

    3.I kept Match type keep as regex and in value added plus mark sign (+)
    /HTML[1]/BODY[1]/DIV[1]//DIV[6]/DIV[+]//DIV[1]/

    I know there are some way to achieve this.

    Could you please help to achieve this ?

    ------------------------------
    Nilesh
    RPA
    Asia/Kolkata
    ------------------------------
  • 5 REPLIES 5

    AmiBarrett
    Level 12
    I ran into this once. Unfortunately, the path parser does not know how to interpret wildcards. In our case, we were looking for a div container of content, not a div item in a pseudo-dropdown, but it should operate about the same.

    The good news is that you already know the rest of the path. Where you have your */? wildcard in, you'll want to feed it a dynamic value. This dynamic value should be a number item, defaulting to whatever your bottom range is; let's assume 52 for now, based on what you've said above. We'll call this data item [Div] for sake of argument. Have the process run a wait stage where check exists = True against this dynamic element. Path searches should take a second or (usually) less, so you can dial down the wait time on this stage. If nothing is found, have a calculation stage set to [Div]+1 and save that new value to [Div]. You'll then want a decision stage, to see if [Div] has exceeded some maximum value; let's assume 300 for now, but change this as you deem appropriate.

    If [Div]>300 results in True, have it toss a system exception that it can't find the element. If it results in False, it should keep incrementing until it (hopefully) finds whatever you're looking for. The element within the application modeler will need to rely on the other filters in order to function properly. So suppose you're looking for an item where Name = Foobar, you need to ensure this filter is enabled so it can find Foobar in the list at whatever div it's checking against at the time.

    Edit: It appears that wildcards are supported.

    ------------------------------
    Ami Barrett
    Sr Product Consultant
    Blue Prism
    Plano, TX
    ------------------------------

    Thanks Ami for your help and quick reply.

    Your logic is too good however today i noticed that element produce 10052 and above number, if i am trying to add number ( like +1) and validate that number if exist or not then it will take too much time and robot ROI will get hamper.

    Really appreciate if you have any other solution.

    Thanks
    Nilesh

    ------------------------------
    Nilesh Jadhav
    RPA Developer
    Asia/Kolkata
    ------------------------------

    Yeesh. I ran some numbers against that and you're right - I'm getting somewhere between now 16 and 46 minutes.

    Are you able to find the element via accessibility? Make sure you have match index, ordinal, parent ordinal, ancestor count and aancestor count enabled.

    ------------------------------
    Ami Barrett
    Sr Product Consultant
    Blue Prism
    Plano, TX
    ------------------------------

    HI Nilesh,

    I would suggest don't use Path like this. Start using real X path. It is very stable and you dont have to worry about the Div numbers.

    Please let me know if you have any doubt.
    To use it just replace the Real X path in absolute x path.

    ------------------------------
    Amlan Sahoo
    RPA Consultant
    Equinix
    ------------------------------
    Regards,
    Amlan Sahoo

    dmma
    Level 5
    Hi, 
    Can you clarify a little bit if you trying to click or interact with dropdown element, which is dynamic?
    Or you are trying to select something from the dropdown, which have stable path? 

    Maybe you can try and spy that element by ID, not by PATH. Check it out.

    ------------------------------
    Kind regards,

    Dmitrij Mamajev
    RPA Developer
    Volvo Cars
    Gothenburg - Sweden
    ------------------------------
    Kind regards, [FirstName] [LastName] [Designation] [JobTitle] [CompanyName] [City] [State] [Phone]